Results 1 to 1 of 1

Thread: Report problem modifcation

  1. #1
    Thread Starter
    adtractiebv's Avatar
    Join Date
    Jul 2014
    Location
    Netherlands
    Posts
    236
    Thanks
    8
    Thanked 17 Times in 16 Posts

    Report problem modifcation

    In Classipress the report-problem icon is not hidden when when you only want logged-in users to be able to report problems.

    If you want to change the report problem bullhorn icon (which people do not understand anyway) by a text like 'report problem' and at the same time only want logged in users to be able to report a problem the following code works:

    /**
    * Displays report listing form.
    * @since 3.4
    *
    * @return void
    */
    function cp_report_listing_button() {
    global $post;

    if ( ! is_singular( array( APP_POST_TYPE ) ) || !current_theme_supports( 'app-reports' ) ) {
    return;
    }

    if ( get_current_user_id() && get_current_user_id() === (int) get_post()->post_author && ! current_user_can( 'manage_options' ) ) {
    return;
    }

    $form = appthemes_get_reports_form( $post->ID, 'post' );
    if ( ! $form ) {
    $content = '';
    } else {
    $close = '<button class="close-button" data-close aria-label="' . esc_attr__( 'Close modal', APP_TD ) . '" type="button"><span aria-hidden="true">&times;</span></button>';

    $content = '<a href="#" data-open="reports_modal_form"class="reports_form_link listing-icon" title="' . esc_attr__( 'Report problem', APP_TD ) . '"><span class="screen-reader-text">' . __( 'Report problem', APP_TD ) . '</span>meld een probleem</i><span class="screen-reader-text">' . __( 'Report problem', APP_TD ) . '</span></a>';
    $content .= '<div class="report-form reveal" id="reports_modal_form" data-reveal>' . $form . $close .'</div>';
    }

    echo $content;
    }

    It replaces the code in classipress > includes > actions.php starting where it says

    /**
    * Displays report listing form.
    * @since 3.4

    and ends with

    echo $content;
    }

    Just copy and paste, and replace 'meld een probleem' with the text you want.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Feature 'Report Problem' does not allow description of the problem
    By andreuerj in forum Help Using ClassiPress
    Replies: 4
    Last Post: February 1st, 2016, 04:56 PM
  2. Report a Problem traslation
    By lsaguiar in forum ClassiPress General Discussion
    Replies: 0
    Last Post: July 6th, 2015, 06:03 AM
  3. Samcy Report Problem
    By ronnie in forum Help Using ClassiPress
    Replies: 2
    Last Post: January 12th, 2015, 01:39 PM
  4. Samcy Report problem
    By francois974 in forum Help Using ClassiPress
    Replies: 3
    Last Post: December 29th, 2014, 01:31 PM