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.
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;
} );
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"
) );
}