Tag Info

Hot answers tagged

2

Your thought is correct. By editing the plugin file you lose updatability. So unregistering and reregistering it in the functions.php would be the correct way to do it.


2

This should work: add_action( 'woocommerce_init', 'remove_wcpgsk_email_order_table' ); function remove_wcpgsk_email_order_table() { global $wcpgsk; remove_action( 'woocommerce_email_after_order_table', array( $wcpgsk, 'wcpgsk_email_after_order_table' ) ); }


2

When I started out with Wordpress I was anti-plugin. I wanted to add everything in my theme's functions.php. When I looked at the bigger picture it began making sense having and leaving some functionalities inside a plugin. There are many write-ups on the subject of what should go into a plugin and what should go into a theme. I, for one, have done one or ...


1

I didn't do this recently but in 2014, in a few WordPress projects that I need additional tables I used Laravel components. In WordPress, if you want to create your own tables by using wpdb and mysql queries. But with the Laravel database classes I managed to do this much more elegantly. A quick rundown how I do this: (note: At the time, I used Laravel 4 ...


1

can I just create one using PHPMYADMIN ? Yes.You can. And its a shortest way to do it.


1

If your plugin is registered like this: class Test_Class_Parent { function __construct() { add_action('wp_head',array($this,'test_method')); } function test_method() { echo 'Echoed from the parent'; } } $p = new Test_Class_Parent(); Then you should be able to remove the filter by accessing the global: class Test_Class_Child extends ...


1

It seems to be a WP default setting, as many Webmasters have gotten this warning and never edited the robots.txt. Removing all the disallows is the easiest solution, but I assume you want some or all of those directories blocked. Google is only concerned about the .js and .css files, so you could in theory edit the robots.txt to include: User-Agent: ...


1

You couldn't have a more perfect solution, since this is precisely what WordPress core itself has to handle. See, in early years WP used just one pass MD5 for passwords. Then they went to better hashing, but obviously it should have kept working with old hashes. Now if you take a look at wp_check_password(), what it is doing (at the moment user attempts to ...


1

You need to flush rewrite rules after adding or modifying rewrite rules in WordPress. flush_rewrite_rules() can be used to flush rules. For more info check these links : https://codex.wordpress.org/Rewrite_API/add_rewrite_rule https://codex.wordpress.org/Function_Reference/flush_rewrite_rules


1

You can use publish_post action hook for notifying post author. function wpcs_author_notification( $post_id ) { $post = get_post( $post_id ); $author = get_userdata( $post->post_author ); $message = "Hi " . $author->display_name . ", Your post, " . $post->post_title . " has just been published at " . get_permalink( $post_id ); ...


1

This is an issue with the creation of the nonce. wp_create_nonce( plugin_basename(__FILE__) ) . '/seo_fields.php" /> should probably be wp_create_nonce( plugin_basename(__FILE__) . '/seo_fields.php' ) . '" /> because otherwise !wp_verify_nonce($_POST['clinicalmeta_noncename'], plugin_basename(__FILE__).'/seo_fields.php') would not check for ...


1

Yes, there is a filter for this. The correct filter is wp_mail and is defined in /wp-includes/pluggable.php Line 135 So the code (maybe in your functions.php) should look something like this: function mail_template($args){ ob_start(); require_once (get_template_directory() . '/mail-templates/contacemail.php'); $args['message'] = ...



Only top voted, non community-wiki answers of a minimum length are eligible