Support Forum » User Profile

Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • in reply to: Icon Field output empty #47726
    Catharina von HobeCatharina von Hobe
    Participant

    Hello,

    I have the same issue with using SVG in json file. I did it like the documantary.

    I use for the output these:

    <?= $value[ 'icon' ] ?? ''; ?>

    Is the issue already fix or is there another way to output SVG?

    Thanks

    in reply to: Empty $object_id in rwmb_after_save_post #44130
    Catharina von HobeCatharina von Hobe
    Participant

    Hello,
    I didnt include the headers but I logged the $_POST['stick-post_stick'] the same way.
    wp_mail('[email protected]', 'Sticky Post Test', "Post : " . $object_id);
    Also suddenly the variable isnt empty, maybe I had a typo somewhere.

    But the post still doesnt get stuck, any ideas for that?

    I tested the sticking functionallity by hardcoding a post id of my custom post type into the stick_post() function, so that shouldnt be the problem.
    And var_dump(get_option('sticky_posts')) displayed me this id in the array.

    in reply to: Empty $object_id in rwmb_after_save_post #44123
    Catharina von HobeCatharina von Hobe
    Participant

    Hello Peter,
    your code does log me the $object_id, but I cannot use the classic Editor for this post type.
    And my Email logging I tried before with and isset($object_id) results to false.

    in reply to: Certain MB Blocks render only in one language #38072
    Catharina von HobeCatharina von Hobe
    Participant

    Hello Long,

    Thanks for your suggestion unfortunately no other plugin is to blame for the error. A screenshot would not help, because you can only see that the block is not rendered in the content.
    I have here the code of the block maybe this helps further:
    https://pastebin.com/fuCjhpMc

    BR
    Alexander

    in reply to: Custom Sanitization in Group subfields #34425
    Catharina von HobeCatharina von Hobe
    Participant

    Ok, that helps but I think its not the best way.

    Can I add my own values to these 4 parameters or am I limited to theses?
    So the function could look like this

    function linkValidation( $value, $field, $old_value, $object_id, $input_to_sanitize ) {
      if(!epmty()){ $functInput = $value[$input_to_sanitize]; }
      else{ $functInput = $value }
    
      ...
    
      return $value;
    }

    And how could I enter the additional Input if this is possible?

    Or $input_to_sanitize as an array for multiple inputs.

    in reply to: Custom Sanitization in Group subfields #34367
    Catharina von HobeCatharina von Hobe
    Participant

    Ok Cool this works, thanks.

    But two more things.
    When I want to use this function several times with different MetaBox fields and groups, in this case, I would have to copy the fundtion for every group ID.

    
    function linkValidationFront($value)
        $functInput = $value['frontpage-head_button-link'];
    
        ...
    
        if($isAny == false): $value['frontpage-head_button-link'] = ''; endif;
                  
        return $value;
    }
    
    function linkValidationPageBlock($value)
        $functInput = $value['subpage-block_button-link'];
    
        ...
    
        if($isAny == false): $value['subpage-block_button-link'] = ''; endif;
                  
        return $value;
    }
    

    Can I make this dynamic again, so it catches the field ID/prefix from the Fields and maybe with a second function the ID from the field that should be validated?

    Secondly,
    I can save the input in wordpress even on false inputs.
    Is there a way to send an error Message and prevent the User from Saving like the required status in wordpress when the validation Filter returns a false input?

    I thought, emptying out that field would trigger the required status of that field, but it seems that this process is applyed after the completion of the saving process.

    Catharina von HobeCatharina von Hobe
    Participant

    Hi Long, thanks for your answer, but I still don't get it. I wrote the following code:

    <h1>Wohnungs-Nr.: {{ post.title }}</h1>

    {% set hauseingang_args = { relationship: { id: 'relationships.hauseingang_mietwohnung.from, from: post.ID }, nopaging: true, post_type: 'hauseingang' } %}
    {% set hauseingaenge = mb.get_posts( hauseingang_args ) %}

      {% for hauseingang in hauseingaenge %}

    • Hauseingang: {{ hauseingang.post_title }}
    • {% set gebaeude_args = { relationship: { id: 'relationships.gebaeude_hauseingang.from', from: hauseingang.ID }, nopaging: true, post_type: 'gebaeude' } %}
      {% set gebaeuden = mb.get_posts( gebaeude_args ) %}

      {% for gebaeude in gebaeuden %}

    • Gebäude: {{ gebaeude.post_title }}
    • {% endfor %}

    {% endfor %}

    And I get the following error:

    Fatal error: Uncaught MetaBox\Dependencies\Twig\Error\SyntaxError: Unexpected character "'" in "wohnung" at line 17. in /home/catharina/public_html/wp_trabrennbahn-farmsen-02/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/dependencies/Twig/Lexer.php:363 Stack trace: #0 /home/catharina/public_html/wp_trabrennbahn-farmsen-02/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/dependencies/Twig/Lexer.php(279): MetaBox\Dependencies\Twig\Lexer->lexExpression() #1 /home/catharina/public_html/wp_trabrennbahn-farmsen-02/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/dependencies/Twig/Lexer.php(180): MetaBox\Dependencies\Twig\Lexer->lexBlock() #2 /home/catharina/public_html/wp_trabrennbahn-farmsen-02/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/dependencies/Twig/Environment.php(460): MetaBox\Dependencies\Twig\Lexer->tokenize() #3 /home/catharina/public_html/wp_trabrennbahn-farmsen-02/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/dependencies/Twig/Environment.php(507): MetaBox\Depende in /home/catharina/public_html/wp_trabrennbahn-farmsen-02/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-views/dependencies/Twig/Lexer.php on line 363

    Can you help me any further? Thanks 🙂

    in reply to: Outputting Data from Cloneable Groups In Custom MB-Blocks #33158
    Catharina von HobeCatharina von Hobe
    Participant

    Ok i also got the repeatin functionality for the static code working, but the images doesnt seem to work correctly this way.

    Do i need to change something for the images?

    <div id="<?= $id ?>" class="cvh--mb-block <?= $class ?>">
      <?php if ( ! empty( $alternating_block_values ) ) {
        foreach (  $alternating_block_values as $alternating_block ) { 
          // Image
          $img = isset( $alternating_block['alternating-block_image'] ) ? $alternating_block['alternating-block_image'] : '';
    ...
    ?>
          <div>
    
        ...
    
        <div  class="ct-div-block ">
          <img alt="" src="<?= $img['full_url'] ?>" class="ct-image cvh--post-rep-ctn-img">
       </div>
      </div>
    <?php }
    
    } ?>
    </div>
    
    in reply to: Outputting Data from Cloneable Groups In Custom MB-Blocks #33154
    Catharina von HobeCatharina von Hobe
    Participant

    And how do i copy the static code for every clone?

    in reply to: Outputting Data from Cloneable Groups In Custom MB-Blocks #33153
    Catharina von HobeCatharina von Hobe
    Participant

    Ah nevermid i figured it out myself.
    I can just copy the echos inside the foreach.

    Thanks for the quick help

    in reply to: Outputting Data from Cloneable Groups In Custom MB-Blocks #33152
    Catharina von HobeCatharina von Hobe
    Participant

    Thanks this works.
    And if i understood the coding correctly i need to copy that for every input or do i need this just once and it can catch every of my 6 other inputs. (excluded the group)

Viewing 11 posts - 1 through 11 (of 11 total)