Forum Replies Created
-
AuthorPosts
-
Catharina von Hobe
ParticipantHello,
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
Catharina von Hobe
ParticipantHello,
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.Catharina von Hobe
ParticipantHello 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.Catharina von Hobe
ParticipantHello 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/fuCjhpMcBR
AlexanderCatharina von Hobe
ParticipantOk, 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 thisfunction 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.
Catharina von Hobe
ParticipantOk 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.
February 27, 2022 at 6:29 AM in reply to: Create a view with information from three different related post types #34172Catharina von Hobe
ParticipantHi 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 🙂
January 11, 2022 at 4:53 PM in reply to: Outputting Data from Cloneable Groups In Custom MB-Blocks #33158Catharina von Hobe
ParticipantOk 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>January 11, 2022 at 4:08 PM in reply to: Outputting Data from Cloneable Groups In Custom MB-Blocks #33154Catharina von Hobe
ParticipantAnd how do i copy the static code for every clone?
January 11, 2022 at 3:59 PM in reply to: Outputting Data from Cloneable Groups In Custom MB-Blocks #33153Catharina von Hobe
ParticipantAh nevermid i figured it out myself.
I can just copy the echos inside the foreach.Thanks for the quick help
January 11, 2022 at 3:57 PM in reply to: Outputting Data from Cloneable Groups In Custom MB-Blocks #33152Catharina von Hobe
ParticipantThanks 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) -
AuthorPosts