Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter wvgdesign

    (@wvgdesign)

    Hi Stefan,

    we use Version 1.8.3… so did we oversee something in the options?

    • This reply was modified 2 years, 2 months ago by wvgdesign.
    Plugin Support Stefan Kalscheuer

    (@stklcode)

    Hi @wvgdesign,

    Apparently the example from the documentation is invalid. The filter should be a function, not a boolean result…

    This should be valid:

    add_filter(
      ‘statify__user_can_see_stats’,
      function( $previous ) {
        return $previous || current_user_can( ‘edit_others_pages’ );
      }
    );

    $previous is the result of previously executed filters or – if none – the default result of Statify which is either true or false. Can be extended as needed.

    Cheery,
    Steafn

    Thread Starter wvgdesign

    (@wvgdesign)

    Hi Stefan,

    thanks for your quick reply… we got an error in WP, please see screenshots here: https://imgur.com/a/5EmWK2x

    Do we have to implement it into functions.php (child theme) in an amended way?

    Thanks,
    Andreas

    Plugin Support Stefan Kalscheuer

    (@stklcode)

    Oh, I see. Copied some wrong quoting signs, so it is not a valid PHP string. Should be highlighted red in the editor and it obviously is not.

    Correct: 'statify__user_can_see_stats'
    Incorrect: ‘statify__user_can_see_stats‘

    Same for both strings.

    Thread Starter wvgdesign

    (@wvgdesign)

    Hi Stefan,

    sorry but… inserted this code

    add_filter(
    ??‘statify__user_can_see_stats’,
    ??function( $previous ) {
    ????return $previous || current_user_can( ‘edit_others_pages’ );
    ??}
    );

    and get this message:

    Deine PHP-Code-?nderungen wurden aufgrund eines Fehlers in Zeile 5 der Datei wp-content/themes/Impreza-child/functions.php zurückgesetzt. Bitte beheben und versuchen, erneut zu speichern.

    syntax error, unexpected ”statify__user_can_see_stats” (T_CONSTANT_ENCAPSED_STRING), expecting ‘)’
    Ausblenden

    Plugin Support Stefan Kalscheuer

    (@stklcode)

    Yours:
    Mine: '

    Different character.
    It may look similar depending on the font, but is not the same.

    Probably typed on some mobile device keyboard or modified by auto“correction“. Only one of them is a valid string delimiter in PHP.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display statify dashboard for editors/users’ is closed to new replies.