Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello, @vmarko! Thanks for the better solution)

    • This reply was modified 3 years, 5 months ago by cro55er.

    I have update on_pre_post_update function at Util_AttachToActions.php and the error is gone (row 63):

    public function on_pre_post_update( $post_id, $post = null ) {
    		$post = get_post( $post_id );
    
    		// if attachment changed - parent post has to be flushed
    		// since there are usually attachments content like title
    		// on the page (gallery).
    		if ( 'attachment' === $post->post_type ) {
    			$post_id = $post->post_parent;
    			$post    = get_post( $post_id );
    		}
    
    		if ( 'draft' !== $post->post_status ) {
    			return;
    		}
    
    		$cacheflush = Dispatcher::component( 'CacheFlush' );
    		$cacheflush->flush_post( $post_id );
    	}

    p.s. I know it’s a dummy code, but it’s work) lol

    • This reply was modified 3 years, 5 months ago by cro55er.
Viewing 2 replies - 1 through 2 (of 2 total)