WordPress Widget Not Saving Instance

The problem is your update function. $old_instance is kind of special variable. The simplest is function update($new_instance, $old_instance) { return $new_instance; } For the safe function update($new_instance, $old_instance) { $instance = array(); $instance[‘name’] = htmlentities($new_instance[‘name’]); $instance[‘divclass’] = htmlentities($new_instance[‘divclass’]); $instance[‘paypal’] = htmlentities($new_instance[‘paypal’]); return $instance; }

Shortcode Output on Top of the Posts [duplicate]

Your function prints the content to the screen instead of returning it. So when the shortcode is called, which happens while the page content is being built in a filterable variable, your function gets called and prints the content before the rest of the page content is rendered. If you modify your function like this, … Read more

Override css rules of a plugin within my own theme

The style_loader_src filter is used to modify/filter the src (url) of a stylesheet. The function callback accepts two parameters, the first is the original src and the second the handler of the stylesheet. The handler is the first parameter of wp_enqueue_style() used to enqueue the stylesheet. So, to replace a stylsheet source with another one … Read more

BuddyPress activity on edit post for a CPT

Use the save_post hook. Try something like: function jude_classified_activity_entry( $post_id, $post, $update ) { $slug = ‘classified’; if ( $slug != $post->post_type ) return; bp_activity_add( // etc ); } add_action( ‘save_post’, ‘jude_classified_activity_entry’, 15, 3 );

Var_dump ACF “API”

Probably nowhere because it outputs too early. I recommend to use error_log function and turn on WP_DEBUG_LOG. Just add to the wp-config.php file somewhere in front of this line: require_once(ABSPATH . ‘wp-settings.php’); these new lines: define( ‘WP_DEBUG’, true ); define( ‘WP_DEBUG_LOG’, true ); Now create in wp-content folder a new file debug.log and set chmod … Read more

Add a function call after content automatically?

You’ve already been pointed to the correct approach and the answer is functionally identical to any of the answers here about appending data to post content. All you need is something like: function my_function () { echo ‘my function content’; } add_action(‘the_content’,’my_function’); To restrict that to single post pages: function my_function () { if (is_single()) … Read more