How to exclude content (and other returned values) from WP_query()?

Like a commented the only way to do it is with a custom sql query so: global $wpdb; $mypages = $wpdb->get_results( “SELECT post_title, post_name FROM $wpdb->posts WHERE post_type=”page” AND post_status=”publish” AND parent=”0″”); if (count($mypages) > 0){ foreach ($mypages as $page){ //do you stuff //$page[‘post_title’] for title //$page[‘post_name’] for slug } }

Developing a plug-in to charge for

I can’t comment yet so I’ll comment here. Start here: https://rudrastyh.com/wordpress/self-hosted-plugin-update.html That’ll give you the basics. Hope you realize the can of worms you’re getting into… payment gateway api’s, registration codes, managing updates, etc. Self-hosting a plugin on your own is not for the feint of heart. I know a number of years ago there … Read more

get plugin directory url

Use plugin_dir_url( __FILE__ ); for the URL and plugin_dir_path( __FILE__ ); for the path. Pass the plugin’s main file to both functions to get similar results. Besides that, ADMIN_PATH and ADMIN_DIR are really poor names for custom code. They might result in collisions with other code in the future. Try to use better names, something … Read more

How to include class from addon after to be sure one class exists in the main plugin?

I found this answer which seems to be good. I used the hooks plugins_loaded and _admin_menu. The hook _admin_menu is before admin_menu so I can add an admin page menu. FooAddon.php namespace PluginFoo; class FooAddon{ public function __construct(){ // Install needed components on plugin activation register_activation_hook( __FILE__, array( $this, ‘install’ ) ); // Include dependencies … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)