Output in XHTML or HTML 5 for plugins?

WordPress will not help you here. In back-end use conservative XHTML 5: <br />, but not <figure> (see WP coding standards). In front-end … it is hard to determine the Doctype and the usage of polyfills, so stay with regular HTML as long as possible or load the necessary polyfills from your plugin.

wordpress get meta value by meta key

WP_Query selects posts and not meta value that is way you are not getting the value. You can use the returned post ID to get the value something like: $args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 1, ‘meta_key’ => ‘picture_upload_1’ ); $dbResult = new WP_Query($args); global $post; if ($dbResult->have_posts()){ $dbResult->the_post(); $value … Read more

Disabling Comment Notifications for Post Author

I skimmed through the source of the wp_notify_postauthor() function and noticed the comment_notification_recipients filter. I wonder if you could simplify your plugin to the following code snippet: <?php /** * Plugin Name: Disable comment/trackback/pingback notifications emails * Plugin URI: http://wordpress.stackexchange.com/a/150141/26350 */ add_filter( ‘comment_notification_recipients’, ‘__return_empty_array’, PHP_INT_MAX ); add_filter( ‘comment_moderation_recipients’, ‘__return_empty_array’, PHP_INT_MAX ); where we use an … Read more

How does WordPress Multisite know that a Plugin is installed?

You can clearly see the way WordPress loads plugins if you inspect the source code of the file wp-settings.php. The function wp_get_active_and_valid_plugins() loads plugins for individual sites in the network and for non-Multi-Site installations, while wp_get_active_network_plugins() loads network activated plugins when Multi-Site is enabled. The former more or less just calls get_option() to get the … Read more

WooCommerce – Load Templates From Plugin For All Template Files

WooCommerce uses the template_include filter/hook to load main templates like archive-product.php and single-product.php. And here’s the class which handles main templates. And there’s a filter in that class which you can use to capture the default file (name) which WooCommerce loads based on the current request/page — e.g. single-product.php for single product pages. You can’t, … Read more

Multiple plugins vs combined one

If it’s exactly the same code, then no – it shouldn’t cause any performance changes… Why? Because loading a plugin is pretty easy (hence quick) process. It all happens in wp-settings.php and this is the code: // Load active plugins. foreach ( wp_get_active_and_valid_plugins() as $plugin ) { wp_register_plugin_realpath( $plugin ); include_once( $plugin ); } unset( … Read more

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