Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 42 total)
  • Author
    Posts
  • JulienJulien
    Participant

    I discover this issue since 18 february and still any fix...

    Why is so long ?

    in reply to: Technical issue with this extension #28649
    JulienJulien
    Participant

    @Hazmi : The problem was on meta-box-aio, read my oldest replies

    @Long Nguyen : I did update with 1.13.13 and all seems to be fine. Thank you

    in reply to: Technical issue with this extension #28627
    JulienJulien
    Participant

    Additional info: I use meta-box-aio (meta-box columns enabled)

    in reply to: Technical issue with this extension #28624
    JulienJulien
    Participant

    Same for me since last update of metabox-aio but only on one single website.
    I don't use composer on this project, standard wordpress install.

    JulienJulien
    Participant

    Hi,

    1 month since my last answer.

    Any news ?

    in reply to: Custom callback not working #24940
    JulienJulien
    Participant
    <?php
    if ( ! isGutenbergElement( logic[0] ) && ! dependentFieldSelector && !compare(logic[0], ')', 'contains') ) {
        return;
    }

    instead of

    <?php
    if ( ! isGutenbergElement( logic[0] ) && ! dependentFieldSelector ) {
        return;
    }

    It could be a real fix ?

    JulienJulien
    Participant

    Hello,

    have you been able to look at this ?

    Sorry to insist but it's a little bit problematic for me.

    JulienJulien
    Participant

    Hello,

    thanks,

    I did a video record with a quick sample test code.

    https://www.youtube.com/watch?v=0gqSSPWWUZ4
    https://gist.github.com/harkor/23a53e40a53908d6de98d505241cc6a8

    Thank you

    in reply to: select_advanced ajax value not saved #24641
    JulienJulien
    Participant

    I found a more sexiest solution.

    It's a continuation of my reply

    Explanations:

    I coded a custom field type based on select_advanced (see documentation).

    This custom field type named "select_advanced_ajax"

    The gist is in two part
    1 - Creation of a Meta Box with a custom Class (MetaBoxClass.php)
    2 - Our custom field type declaration (RWMB_Select_advanced_ajax_Field.php)

    When the field is saved, we add in the database the hidden field.

    My code : https://gist.github.com/harkor/2fad09a642a096eb0a48984669211312

    I didn't want create a javascript file for that because it's make a third file.

    Feel free to adapt.

    If the support team have a better solution give it to me 😀

    in reply to: select_advanced ajax value not saved #24639
    JulienJulien
    Participant

    Another solution (without ajax) is populate the options array in PHP but this code execute each loading page of WordPress (front and back).

    So we need to make conditions to populate only when we edit page but in case we have a large set or the populate function is long to fill, it's not a good solution.

    Sample code here

    in reply to: select_advanced ajax value not saved #24637
    JulienJulien
    Participant

    Correction
    After some research, the value is in database but the select is empty on the backend.

    So I found an hack but it's not really sexy.

    You can find adaptation here

    My "temporary" solution is setting 2 more fields
    1 - html field for jquery script
    2 - hidden field to option value for select2

    When select_advanced field change, hidden field is updated with values of select_advanced
    When the page load, we populate select_advanced with the hidden field

    You can maybe adapt "select_advanced" to detect when we are in ajax situation and populate with an hidden_field like I did ?

    See documentation of Select2

    in reply to: select_advanced ajax value not saved #24636
    JulienJulien
    Participant

    Additional informations

    For this test, if Meta Box AIO disabled, problem still persist.

    in reply to: Templating engine like Blade not rendering ? #21799
    JulienJulien
    Participant

    Thanks for your response but I did the trick on my first reply. Did you see it ?

    For the code on your reply, you didn't read code correctly, if the render_callback exist, the function render_callback is called and then stop because you have a "return;"

    in reply to: Templating engine like Blade not rendering ? #21788
    JulienJulien
    Participant

    We could maybe add information about render_template into the "set_block_data" function as follow ?

    Base

    private function set_block_data( &$attributes ) {
            $attributes['name'] = $this->id;
            $data = isset( $attributes['data'] ) ? $attributes['data'] : [];
            $this->storage->set_data( $data );
            ActiveBlock::set_block_name( $this->id );
        }

    Into

    private function set_block_data( &$attributes ) {
            $attributes['name'] = $this->id;
            $attributes['render_template'] = $this->render_template;
            $data = isset( $attributes['data'] ) ? $attributes['data'] : [];
            $this->storage->set_data( $data );
            ActiveBlock::set_block_name( $this->id );
        }
    in reply to: Templating engine like Blade not rendering ? #21785
    JulienJulien
    Participant

    I found a solution with the render_callback, do you think it's possible to get the render_template value inside the callback ?

    With this value I can make only one render_callback for all of my custom blocks.

    There is the current solution for someone who need it

    public function my_hero_callback($attributes, $is_preview = false, $post_id = null){
    
        if (file_exists(get_theme_file_path("views/blocks/hero.blade.php"))) {
          echo \App\template("blocks.hero", [
            'attributes' => $attributes,
            'is_preview' => $is_preview,
            'post_id' => $post_id
          ]);
        }
    
      }
Viewing 15 posts - 16 through 30 (of 42 total)