Forum Replies Created

Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter shnalla

    (@shnalla)

    My bad… I did a new try and it works well.
    Topic can be closed !

    My bad… You just have to check “Hide Controls” on the gallery popup…!

    Same question, how to remove these bullets ? I know, i can just use CSS but is there a better way to it ?

    shnalla

    (@shnalla)

    thanks for the tips mr_dw. Works well for me ??

    Thread Starter shnalla

    (@shnalla)

    Hi FolkeW,

    Many thanks for your feedback ??
    I ‘ll give this a look soon ??

    Thread Starter shnalla

    (@shnalla)

    If anyone want to do the same thing, here is how to do.

    In function.php add the following:

    // Custom action to do any additional logic after attachment is uploaded
    	function my_fu_after_upload( $media_ids, $success ) {
    		// Iterate array with attachment ids
    		foreach( (array) $media_ids as $media_id ) {
    
    			// Term is just an example, all $_POST variables should be available to you
    			$term = sanitize_text_field( $_POST['post_tags'] );
    
    			wp_set_object_terms( $media_id, $term, 'imagetype', true );
    		}
    	}
    add_action( 'fu_after_upload', 'my_fu_after_upload', 10, 2 );

    Then in the form, add an input:
    [input type="text" name="post_tags" id="ug_tags" description="Mot-clef" multiple=""]

    Be careful, $term = sanitize_text_field( $_POST[‘post_tags‘] ); where post_tags is your input’s name ??

    Thread Starter shnalla

    (@shnalla)

    Hey Rinat,

    After cleaning function.php it works like a charm !
    Thanks a lot for your help !

    Thread Starter shnalla

    (@shnalla)

    I moved action_init and all hooks in function.php.
    Got no errors, but I can’t retrieve the tag from the upload form.

    Do you have any idea ?

    Thread Starter shnalla

    (@shnalla)

    Is this correct ?

    Thread Starter shnalla

    (@shnalla)

    It doesn’t seem to work.

    The code is in frontend-uploader.php, here is the input

    [input type="text" name="post_tags" id="ug_tags" description="Mot-clef" multiple=""]

    and the function

    // Custom action to do any additional logic after attachment is uploaded
    	function my_fu_after_upload( $media_ids, $success ) {
    		// Iterate array with attachment ids
    		foreach( (array) $media_ids as $media_id ) {
    
    			// Term is just an example, all $_POST variables should be available to you
    			$term = sanitize_text_field( $_POST['post_tags'] );
    
    			wp_set_object_terms( $media_id, $term, 'imagetype', true );
    		}
    	}
    add_action( 'fu_after_upload', 'my_fu_after_upload', 10, 2 ); is in function __construct().

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    I have no error message, but I cannot retrieve any tag.

    Thread Starter shnalla

    (@shnalla)

    Thank you Rinat.

    I get the whole idea… but I am not sure to know what “my_custom_term” is related to.
    Is it an input name or my taxonomy name ?

    In fact, I have added an input like this to handle tags.

    [input type=”text” name=”tags” id=”ug_tags” description=”Mot-clef” multiple=””]

    I don’t know how to link it to the code you just posted above.

    Thread Starter shnalla

    (@shnalla)

    Hi Rinat,

    I’am ready to add PHP Code. In fact I already add tags support for attachment with a bit of code :

    add_action(‘init’, ‘create_image_taxonomies’);

    function create_image_taxonomies() {
    $labels = array(
    ‘name’ => ‘Media Category’
    );

    $args = array(
    ‘labels’ => $labels,
    ‘public’ => true
    );

    register_taxonomy(‘imagetype’, ‘attachment’, $args);
    }

    // Add a new column
    add_filter(‘manage_media_columns’, ‘add_topic_column’);
    function add_topic_column($posts_columns) {
    $posts_columns[‘att_topic’] = _x(‘Topic’, ‘column name’);
    return $posts_columns;
    }

    // Register the column as sortable
    function topic_column_register_sortable( $columns ) {
    $columns[‘att_topic’] = ‘att_topic’;
    return $columns;
    }
    add_filter( ‘manage_upload_sortable_columns’, ‘topic_column_register_sortable’ );

    add_action(‘manage_media_custom_column’, ‘manage_attachment_topic_column’, 10, 2);
    function manage_attachment_topic_column($column_name, $id) {
    switch($column_name) {
    case ‘att_topic’:
    $tagparent = “upload.php?”;
    $tags = wp_get_object_terms( $id, ‘taxonomy_name’, ” );
    if ( !empty( $tags ) ) {
    $out = array();
    foreach ( $tags as $c )
    $out[] = “slug’> ” . esc_html(sanitize_term_field(‘name’
    , $c->name, $c->term_id, ‘post_tag’, ‘display’)) . “
    “;
    echo join( ‘, ‘, $out );
    } else {
    _e(‘No Topics’);
    }
    break;
    default:
    break;
    }
    }

    I works great in admin side, but I wonder how to make it works with Frontend Uploader…

    Forum: Plugins
    In reply to: [Form Lightbox] Button link

    I think I have an answer : on the link shortcode, add CSS class in Class=”yourID add your class here”

    [formlightbox_call title="Poser une question sur ce produit" class="1322379893472 orange"]

    It’s that easy !

    Here is a better way to do this :

    <?php
    // The Query
    $query = new WP_Query( 'product_tag=-10%' );
    
    echo '<ul>';
    // The Loop
    while( $query->have_posts() ):
    	$query->next_post();
    	echo '<li>';
    	echo '<h3><a href="'. get_permalink( $query->post->ID ) . '">' . get_the_title( $query->post->ID ) . '</a></h3>';
    	echo get_the_post_thumbnail( $query->post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) );
    	echo '</li>';
    endwhile;
    echo '</ul>';
    // Restore original Query & Post Data
    wp_reset_query();
    wp_reset_postdata();
    ?>

    Hope it helps !

    You can try query_posts( ‘product_tag=yourTag’ ); .
    According to woocommerce support, it works like wordpress tags ??

Viewing 15 replies - 1 through 15 (of 16 total)