Forum Replies Created

Viewing 15 replies - 1 through 15 (of 32 total)
  • Thread Starter Mxlaxe

    (@mxlaxe)

    Hi, thank you so much for the detailed explanation !

    This looks like it could do ?? I will try this out.

    However I need to make sure this can work without providing a specific widget ID but seems like I’m on right track !

    Thank you!

    Thread Starter Mxlaxe

    (@mxlaxe)

    Yes !

    It is working now, I also followed your link and made a couple minor changes and it’s fine!

    Thank you so much for your help!

    Thread Starter Mxlaxe

    (@mxlaxe)

    Okay I got some updates,

    My website is using several hooks provided by the plugin and it seems that they cause the problem because the shortcode works if I comment it all out but then I lose all my custom modifs.

    In the v3, I added some custom field in the review form and I got to something working with these filters (2 of them were deprecated and I changed the filters to their new name)

    Can you spot something wrong in the below code ? (was working in v3)

    * @return array
    */
    add_filter( 'site-reviews/review-form/order', function( $order ) {
    // The $order array contains the field keys returned below.
    // Simply add any custom field keys that you have added and change them to the desired order.
    return [
    'rating',
    'title',
    'website', // this is a custom field key
    'content',
    'name',
    'email',
    'terms',
    ];
    }); /**
    * Modifies the submission form field rules
    * Paste this in your active theme's functions.php file.
    * @return array
    */
    add_filter( 'site-reviews/validation/rules', function( $rules ) {
    $rules['website'] = 'required';
    return $rules;
    }); /**
    * Displays custom fields in the Review's "Details" metabox
    * Paste this in your active theme's functions.php file.
    * @return array
    */
    add_filter( 'site-reviews/metabox/details', function( $metabox, $review ) {
    foreach( $review->custom as $key => $value ) {
    $metabox[$key] = $value;
    }
    return $metabox;
    }, 10, 2 ); /**
    * Renders the custom review fields
    * Paste this in your active theme's functions.php file.
    * In order to display the rendered custom fields, you will need to use a custom "review.php" template
    * as shown in the plugin FAQ ("How do I change the order of the review fields?")
    * and you will need to add your custom keys to it, for example: {{ name_of_your_custom_key }}
    * @return array
    */
    add_filter('site-reviews/review/build/after', function( $renderedFields, $review ) {
    foreach ($review->custom as $key => $value) {
    if (substr($value, 0, 1) === '@' && filter_var(substr($value, 1), FILTER_VALIDATE_URL)) {
    $rel = "";
    $url = substr($value, 1);
    } else {
    $rel = ' rel="nofollow"';
    $url = $value;
    }
    if ($value) {
    $renderedFields[$key] = '<div class="glsr-custom-' . $key . '"><a target="_blank" href="' . $url . '" title="' . $url . '"' . $rel . '>' . get_host($url) . '</a></div>';
    } else {
    $renderedFields[$key] = '';
    }
    return $renderedFields;
    }
    return;
    }, 10, 2);

    I am also using a custom site-reviews/review.php template like so:

    <?php defined( 'WPINC' ) || die; ?>
    
    <div class="glsr-review">
    ? ? {{ title }}
    ? ? {{ rating }}
    ? ? {{ date }}
    ? ? {{ assigned_to }}
    ? ? {{ content }}
    ? ? {{ avatar }}
    ? ? {{ author }}
    ? ? {{ website }}
    ? ? {{ response }}
    </div>
    Thread Starter Mxlaxe

    (@mxlaxe)

    Yes, I ran the migration, optimized everything I could from the tools section but nothing worked so far. I’m not sure what to do next, but I will try something else.

    Thread Starter Mxlaxe

    (@mxlaxe)

    Hi @zoonini,

    Thank you for your reply, I was unaware of this function and that could indeed work in my case !

    Have a nice one !

    Thread Starter Mxlaxe

    (@mxlaxe)

    @jdembowski I’m confused why you moved my topic to “Fixing WordPress”. I’ve got nothing to fix related to “For any problems encountered after setting up WordPress.”.

    I am trying to develop a gutenberg functionnality from scratch with Reactjs (as explained above) but I don’t know exactly where to start.

    Any help ?

    Thanks

    Thread Starter Mxlaxe

    (@mxlaxe)

    Hi,

    Thanks for the reply. This unfortunately solves only half the problem, because I need a custom message for another language as my website is multilingual and as far as I know there is no way to have global restricted messages per language.

    Please consider adding a filter on the final output of the restricted message, whether it’s global or custom.

    Cheers!

    Thread Starter Mxlaxe

    (@mxlaxe)

    Thank you @plantprogrammer, will look into that!

    @mateithemeisle It would be great however to have the option (from the theme’s options) to choose which sidebar to display for a specific post type or archive.

    Thread Starter Mxlaxe

    (@mxlaxe)

    Thank you,

    Actually I’m already using a child theme, however this does not explain how to setup a custom sidebar on an archive page.

    Any thoughts on this ?

    Thanks!

    Thank you! it seems like PHP 8 will give many plugins a hard time. Maybe it’s still too early to adopt it.

    Hi,

    Any update on the fix?

    I get the same FATAL ERROR with PHP 8:

    PHP Fatal error: Unparenthesizeda ? b : c ? d : eis not supported. Use either(a ? b : c) ? d : eora ? b : (c ? d : e)in /home/***/public_html/wp-content/plugins/wp-socializer/core/templates/floating-sharebar.php on line 180

    Thanks!

    Thread Starter Mxlaxe

    (@mxlaxe)

    Replying to myself: I somehow managed to find a way to make this work.

    After logging in with the wp_signon() function, I called the following hook like so:

    $myuser = null;
    if ( class_exists('\\SimpleWpMembership')){
       $myuser = do_action( 'swpm_login', $user, $pwd, true);
    }

    Then when I try to go to the profile page, I can access it without being asked to login like before.

    However, the plugin’s API is not very clear to understand and the separate user management from the WP built-in user system adds a layer of complexity.

    Thread Starter Mxlaxe

    (@mxlaxe)

    Any help on this particular problem would be highly appreciated.
    Let me know if you could identify the issue.
    Thanks

    Thread Starter Mxlaxe

    (@mxlaxe)

    No there is none installed.

    The call to wp_signon() is made like this: through an ajax call first, then the php function runs the wp_signon(), and finally the page is reloaded on success.

    I am just wondering how does the sync process work. Does it hook into the core login function ? Why isn’t the sync working in this scenario ?

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