Dashboard Disappears after Upgrade

That is a seriously wonky plugin, my friend. Prologue Before we actually start, trash this conditional – it does absolutely nothing: if($_REQUEST[‘s’] != ”) { } But really, more than likely, the original plugin developer had intended this conditional to actually do something by bailing out of the function if $_REQUEST[‘s’] is not set (seeings … Read more

add function to saving change on Options Pages

To execute a task after a option has been updated, you can use updated_option action hook: add_action( ‘updated_option’, ‘updated_option_callback’, 10, 3 ); function updated_option_callback( $option, $old_value, $value ) { //Do something } Also, you can use update_option_{option-name} specifically for each option. For example: add_action( ‘update_option_new_option_name’, ‘update_new_option_name_callback’, 10, 2 ); function update_new_option_name_callback( $old_value, $value ) { … Read more

How to show category images (from plugin) on a regular page (page-example.php)?

Untested, but something like this should work. $siteurl = home_url(“https://wordpress.stackexchange.com/”); $tax = ‘region’; // slug of taxonomy $terms = get_terms($tax); foreach ($terms as $term) { $id = $term->term_id; $slug = $term->slug; $description = $term->description; $image_url = z_taxonomy_image_url( $id, NULL, TRUE ); $link = “<a href=”https://wordpress.stackexchange.com/questions/176555/$siteurl?$tax=$slug” ><h1> $term->name </h1></a>”; echo $link; echo ‘<p>’ . $description . … Read more

WordPress Plugin Boilerplate – add_action hook in static “activate” function

The problem is the initialization in WordPress via register_activation_hook( __FILE__, ‘activate_IWCollege_Courses’ ); The function was fired on the Activation of a plugin, not more. You must switch to the hook init. For Custom Post types, the init hook is recommended in the codex. Custom post types must be registered during every WordPress initialization. But the … Read more

Add Fields with Sub-Fields to WP Job Manager

I see a few things missing in your snippet/code. Each field (your location ones) need to include priority: ‘priority’ => 19, You defined ‘type’ as ‘location’ but did not define that field type. The repeated files in resume manager where you based this code on defines template files for education, experience etc. To define your … Read more

How to remove an Ajax action

The main issue I was having is that when an ajax request hits not all hooks are being loaded. I used this code: $return = array(); foreach( $GLOBALS[‘wp_actions’] as $action => $count ) { $return[“message”] .= $action . “, “; } wp_send_json($return); This showed me the hooks that were running before and I got it … Read more