markilfin
Forum Replies Created
-
Forum: Plugins
In reply to: [Contact Form 7] Word “ARRAY” in the end of emailI have the exact same issue screenshot
- This reply was modified 3 years, 4 months ago by markilfin.
Thank you for your quick answer. Yes, this helped me a lot.
Forum: Plugins
In reply to: [Yoast Duplicate Post] Bulk action on frontendHere is how i did it:
1. i addeddata-id
for every post
<article <?php post_class( 'single-slide' ); ?> id="post-<?php the_ID(); ?>" data-id="<?php the_ID(); ?>"></article>
2. via js i’m collecting these ids and redirect the page with predefined parameterposts_to_clone
:const button = document.getElementById('clone-all-slides'); button.addEventListener('click', () => { let slides = document.getElementsByClassName('single-slide'); let ids = ''; for (let i = 0; i < slides.length; i++) { ids += (slides.length - 1) !== i ? <code>${slides[i].dataset.id},</code> : <code>${slides[i].dataset.id}</code>; } window.location.href = <code>${window.location.href}wp-admin/edit.php?posts_to_clone=${ids}</code>; });
3. in functions.php i’m checking if parameter
posts_to_clone
exists and if it does, i’m making clone for every id it has via duplicate_post_create_duplicate:function frontend_bulk_clone () { if ( is_admin() && isset( $_GET['posts_to_clone'] ) ) { $posts_to_clone = ( explode( ',', $_GET['posts_to_clone'] ) ); foreach ( $posts_to_clone as $post_id ) { $post = get_post( $post_id ); if ( ! empty( $post ) ) { if ( ! is_post_type_hierarchical( $post->post_type ) || is_post_type_hierarchical( $post->post_type ) ) { duplicate_post_create_duplicate( $post ); } } } wp_redirect( get_site_url() . '/user', 301 ); exit; } } add_action( 'wp', 'frontend_bulk_clone' );
I know, this is a little bit dirty, but it works.
Any improvements or remarks are welcome.
Thanks!- This reply was modified 4 years, 10 months ago by markilfin.
Forum: Plugins
In reply to: [Themify - WooCommerce Product Filter] Get active filtersOk, thank you! I can do it myself, just wanted to know if maybe such option already realized and just not mentioned in docs.
Forum: Plugins
In reply to: [Themify - WooCommerce Product Filter] Get active filtersYes, of course.
For example, we have two blocks: 1. sidebar with filters; 2. and main content area with products.
Lets say user has selected “t-shirts” and “size 6” from our filters. So these are our “active filters”.
Meanwhile, in content area with our products, i want to show a text block with info: “You choose: {list with our active filters}”.Something similar to this https://prntscr.com/phof36