making a search.php query

You are missing the search parameter in your arguments. The code below, when added to the array in $the_query, should pass along the query string variable from a search: ‘s’ => $s Documentation is available here: https://codex.wordpress.org/Class_Reference/WP_Query#Search_Parameter

Force ‘permanent’ post cache of shortcode results

You’d want to look up transients Here’s a simple example of how you do it. function showPosts (){ $posts = get_transient (“my_rss_transient”); If (!$posts){$posts=getPosts ();} /* do showing off stuff here */ } function getPosts (){ $posts = /* get posts here*/ Set_transient (“my_rss_transient”, $posts, MONTH_IN_SECONDS); return $posts } The transient should be saved for … Read more

Metabox – Displaying the Value of a Metabox

After reviewing your code there are a couple of things you need to change depending on where the meta content is being held. Try this to get the value $desc = get_post_meta( get_the_ID(), ‘meta_desc’, TRUE ); echo $desc; That Will be give you the appropriate meta.

Trouble with checked() for array of multiple checkboxes

Why take empty answer foreach ( $options as $key => $title ) { rpq_plugin_debug_var( $key, ‘Key: ‘ ); rpq_plugin_debug_var( $title, ‘Title: ‘ ); $checked = checked((in_array($title, $values)), true, false); After this loop end you get empty $checked because it replace every loop step. Trace: 1: $checked = ‘checked=”checked”‘ 2: $checked = ”; 3: $checked = … Read more

Comparing Dates within plugin using PHP If statement

$current_date is a timestamp and $compare_date is a formatted date, so you’re comparing different things. As you’re already using DateTime and as of PHP 5.2.2 DateTime objects can be compared using comparison operators, you can compare instead $expired_date (DateTime object) with today’s date as a DateTime object: $current_date = new DateTime(); $expired = new DateTime(); … Read more

Adding action item to admin users table and sending email

Thanks for that guidance, mmm. That was helpful. I resolved the problem this way: // Adds “Send rejection email” action to Users page function jm_send_rejection_link($actions, $user_object) { if( ($_GET[‘action’] == ‘jm_send_rejection’) && ($_GET[‘user’] == $user_object->user_email) ) { $sendto = $_GET[‘user’]; $sendsub = “Your registration has been rejected.”; $sendmess = “Your registration for has been rejected.”; … Read more