warning: trying to access array offset on value of type bool ACF field image group
warning: trying to access array offset on value of type bool ACF field image group
warning: trying to access array offset on value of type bool ACF field image group
How to force Cover block to use the full size image resolution
post_content return zero!
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 cache results of of get_available_post_statuses() function as it is causing a slow query on a website with over 1 million posts?
disable a specefic sidebar when user is log out
Thanks to @TomJNowell’s hint I managed to get it working with a simple check if the post already exists (using the post_exists function). This code is included in the functions.php file. Additionally, the loop only runs if called from the backend using the is_admin function. Here’s the working example: function ekesto_insert_post(){ // config $post_type=”event”; // … Read more
pre_get_comments to restrict current users view of edit-comment.php to their comments
I solved in this way $wpdb->query( $wpdb->prepare( “DELETE FROM $table_name WHERE Date < now() – INTERVAL 30 DAY”) );
This is the pattern for a filter. Applying/using a filter on something: $filtered_version = apply_filters( ‘the name of the filter’, $the_thing_being_filtered ); This is how you use a filter to modify something: add_filter( ‘the name of the filter’, ‘name_of_a_function_that_will_modify_the_thing_being_filtered’ ); function name_of_a_function_that_will_modify_the_thing_being_filtered( $the_thing_being_filtered ) { // modify $the_thing_being_filtered here return $the_thing_being_filtered; } So in your … Read more