filatovdanyl
Forum Replies Created
Viewing 5 replies - 1 through 5 (of 5 total)
-
Forum: Plugins
In reply to: [WooCommerce] Woocommerce product tab locked Version 7.7.0to add, you can also remove template lock – so it will add the template for new products, but won’t lock it, and won’t lock existing products:
function woo_product_gutenberg_template_remove_lock( $args ) { $args['template_lock'] = false; return $args; } add_filter( 'woocommerce_register_post_type_product', 'woo_product_gutenberg_template_remove_lock' );
Yep, works now, both multiple post snippet blocks on one page and spaces in fields, thanks.
Great, thanks!
Hi @robert681
Installed your patch and removed my fix – works, no errors!
Just to confirm, this issue is happening with the interim login only, right?
– yes probably ??
Forum: Plugins
In reply to: [Revisionize] Revision preview not showing changesMy fix is to change the permalink in revision by adding some unique slug to it and then removing that when publishing it back into original post:
// revisionize: revision draft preview not showing changes - fix add_action( 'revisionize_after_create_revision', function( $original_id, $revision_id ) { // adding a unique slug to revision permalink that will be removed when publishing it back to original $add_slug = '-revisionize_some_slug'; // updating post_name didn't work with revisionize to change permalink of revision. post_name was actually empty on revision post $permalink = get_post_meta( $revision_id, 'custom_permalink', true ); if ( substr( $permalink, -1 ) === '/' ) { $permalink = substr( $permalink, 0, -1 ) . $add_slug . '/'; } else { $permalink .= $add_slug; } update_post_meta( $revision_id, 'custom_permalink', $permalink ); }, 10, 2 ); add_action( 'revisionize_before_publish', function( $original_id, $revision_id ) { // removing our unique slug from permalink before publishing revision into original update_post_meta( $revision_id, 'custom_permalink', str_replace( '-revisionize_some_slug', '', get_post_meta( $revision_id, 'custom_permalink', true ) ) ); }, 10, 2 );
Viewing 5 replies - 1 through 5 (of 5 total)