How to send mail to subscribers using wp_mail

You were on the right track when you built your WP_User_Query, but you are not using the result of this query. See this: //verify post is not a revision if ( !wp_is_post_revision( $post_id ) ) { //gets subscirbers to send email to // WP_User_Query arguments $args = array ( ‘role’ => ‘Subscriber’, ); // The … Read more

Get post values of form created by widget in sidebar

Your form needs to have method=”post” and action=”someScript.php” defined. It will send the post variables to wherever you deifine in your action=”” <form method=”post” action=”someScript.php” > <p> <label for=”db_sub_name”>Name</label> <input type=”text” name=”db_sub_name” id=”db_sub_name” value=”” placeholder=”Enter your Name”> </p> <p> <label for=”db_sub_name”>Email</label> <input type=”text” name=”db_sub_email” id=”db_sub_email” value=”” placeholder=”Enter your Email”> </p> <p> <input style=”float:right;” type=”submit” /> … Read more

How to Display a Plugin function (content) on frontpage using index.php

Your plugin inserts its feelbox widget by filtering the_content: if ($options[‘showinpostsondefault’] == ‘on’) { add_filter(‘the_content’, ‘add_feelbox_widget_to_posts’); } But your index page doesn’t display the_content, just Title, featured thumbnail, an excerpt and, number of comments. The plugin code you’ve shown us doesn’t include a print_feelbox_widget() function. Does such a function actually exist in your plugin? (Also, … Read more

plugin style conflicts, how to override? [closed]

On the definition of the aio-orange button in the all-in-one-buttons/css/display.css?ver=4.1.1 add !important after the #FFF. The color is overwritten because you load the AIO styles first and later some other style that overrides button styles or what not. With !important you can tell the browser to use that one even though it’s not the latest … Read more

Remove Duplicator plugin from admin menu if not an administrator

After a bit more research, I have found a way to do this from this post https://wordpress.stackexchange.com/a/136064/54989 Rather than using unset as I had done previously, remove_menu_page works for Duplicator: remove_menu_page( ‘duplicator’ ); so my complete code now looks like: function jitb_remove_admin_menu_items() { if ( !current_user_can( ‘manage_options’ ) ) { $remove_menu_items = array( __( ‘Comments’ … Read more

Private Plugin Updates – Localhost

As it turns out there’s a difference between 127.0.0.1 and localhost. Once I change my requests to: http://localhost/white/check-plugins/plugins/test-plugin.zip and a few other instances of the IP version, the update worked like a charm. Stack Overflow has some good answers on why this could be: What is the difference between 127.0.0.1 and localhost?

Issue using wp-load.php in WordPress Plugin Development

The problem in this solution is, that the location of this file are different. WordPress allow the definition of the folder of plugins and themes, different to your static path check for the wp-load.php. Example for custom paths //* // Custom content directory define( ‘WP_CONTENT_DIR’, dirname( __FILE__ ) . ‘/wp-content’ ); define( ‘WP_CONTENT_URL’, ‘http://’ . … Read more