Suporte » Desenvolvendo com WordPress » Como faço para salvar o termo?

  • Como faço para salvar o termo?

    function functiondolarfull( $post_id ) {
    $terms10 = ”;
    
    $getslugid = wp_get_post_terms( $post_id, ‘my_taxonomy’ );
    $slugs = implode(‘, ‘,wp_list_pluck($getslugid,’slug’));
    ?>
    
    <div class=”dolarfull-label”>
    <label>Dolar Full</label>
    </div>
    
    <div class=”dolarfull-fields”>
    <input type=”text” name=”testgo1″ value=”<?php echo $slugs; ?>”>
    </div>
    <?php
    }
    
    add_action( ‘ACTIONHOOKDOLARFULL’, ‘functiondolarfull’, 10, 3 );

    o topo está bem

    o problema está em baixo

    function update_my_function( $post_id ) {
    if ( isset( $_POST[‘my_custom_field’] ) ) {
    wp_update_term(10000000000000000, ‘my_taxonomy’, array(‘name’ => $_POST[‘my_custom_field’]));
    }
Visualizando 1 resposta (de um total de 1)
  • Criador do tópico manoodin

    (@manoodin)

    Como faço para salvar o termo?

    function functiondolarfull( $post_id ) {
    $terms10 = ”;

    $getslugid = wp_get_post_terms( $post_id, ‘my_taxonomy’ );
    $slugs = implode(‘, ‘,wp_list_pluck($getslugid,’slug’));
    ?>

    <div class=”dolarfull-label”>
    <label>Dolar Full</label>
    </div>

    <div class=”dolarfull-fields”>
    <input type=”text” name=”testgo1″ value=”<?php echo $slugs; ?>”>
    </div>
    <?php
    }

    add_action( ‘ACTIONHOOKDOLARFULL’, ‘functiondolarfull’, 10, 3 );
    o topo está bem

    o problema está em baixo

    function update_my_function( $post_id ) {
    if ( isset( $_POST[‘testgo1’] ) ) {
    wp_update_term(10000000000000000, ‘my_taxonomy’, array(‘name’ => $_POST[‘testgo1’]));
    }

Visualizando 1 resposta (de um total de 1)
  • O tópico ‘Como faço para salvar o termo?’ está fechado para novas respostas.