• Hi Greg,

    Am using below shortcodes and all my adds go live immediately without moderation, what would be the problem?

    [adverts_add moderate=”1″]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    the second quote character seems to be off, most likely WP editor converted it to UTF-8 character and now the shortcode does not recognize this param.

    Edit the page with the [adverts_add] shortcode from wp-admin / Pages panel and:
    – if you are using Gutenberg remove the shortcode and add a new Shortcode block and type the shortcode there from the keyboard (do not copy and paste it as an incorrect character might be copied again).
    – if you are using a normal editor then click the Text tab, remove the shortcode and type it again from the keyboard.

    Thread Starter pmmungai86

    (@pmmungai86)

    I made the changes and nothing, but i realized this code needs to be changed to allow moderation, kindly assist.

    add_action( "template_redirect", function( $tpl ) {
        if( adverts_request( "_adverts_action" ) != "save" ) {
            return $tpl;
        }
        
        include_once ADVERTS_PATH . "includes/class-shortcode-adverts-add.php";
        
        $shortcode = new Adverts_Shortcode_Adverts_Add();
        $shortcode->load_args_from_checksum();
        $shortcode->init();
        $save = $shortcode->action_save();
        if( stripos( $save, "Could not validate." ) === false ) {
            wp_redirect( "https://gido.website" );
            exit;
        } 
    
        return $tpl;
    } );
    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    actually, this code should not affect the moderate param that is it should set it to “pending” automatically but to be sure it will do that after the line

    
    $save = $shortcode->action_save();
    

    add

    
    if( $shortcode->get_post_id() > 0 ) {
      wp_update_post( array(
        "ID" => $shortcode->get_post_id(),
        "post_status" => "pending"
      ) );
    }
    
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Moderate’ is closed to new replies.