Add custom button to the changeset status in the Customizer

Unfortunately there is no official hook for customizer actions yet. Since the customizer actions are predefined by javascript, you can use the The Customizer JavaScript API to add new actions via the push function. PHP function for the index.php/functions.php: // Include scripts in customizer. add_action( ‘customize_controls_enqueue_scripts’, ‘script’ ); function script() { wp_enqueue_script( ‘custom-customize-controls’, plugin_dir_url( __FILE__ … Read more

wp_update_post breaks my function

Found the answer thanks to Jacobs comments + this similar thread: I had to use remove_action() WITH matching priority, like this: function booking_meta( $post_id, $post, $update ) { if ( get_post_type( $post_id ) !== ‘booking’ ) { return; } // Update ACF fields $object_id = get_the_ID(); $owner_id = get_the_author_meta( ‘ID’, $post->post_author ); update_field( ‘object’, $object_id, … Read more

How to use add_filter to add the extra data to existing array?

The code you provided looks correct, and it should work as expected. However, if you want to add the ‘give_phone’ option using a filter, you would need to modify the code to include the filter hook and the callback function. Here’s the modified code: function additional_field($options) { $options[‘give_phone’] = __( ‘Phone’, ‘give’ ); return $options; … Read more