Hi,
1. you can paste the code visible here in your theme functions.php file https://github.com/gwin/wpadverts-snippets/blob/master/limit-category-selection/limit-category-selection.php
2. this is not really possible right now i am afraid, as the Preview step actually saves the Ad.
3. adding the code below yo your theme functions.php will disable tinymce editor in the frontend, but note it will still accept some basic HTML tags.
add_filter( 'adverts_form_load', 'disable_form_tinymce' );
function disable_form_tinymce( $form ) {
if($form['name'] != 'advert') {
return $form;
}
foreach($form['field'] as $k => $field) {
if($field['name'] == 'post_content') {
$form["field"][$k]["mode"] = "plain-text";
}
}
return $form;
}
Thread Starter
Flo
(@flow31)
Thanks for your answer !
2. In shortcode_adverts_add function (shortcodes.php) i have changed the insert post args for $action= ‘preview’ (from ‘adverts_tmp_post_status()’ to ‘pending’ ), then replace the form by a success message in add-preview.php template.
It’s seem to work, do you think that will may cause problem ?
Hmm technically it shouldn’t, i can’t tell for sure, if you test it and it works then it should be ok.
Of course the changes you made in original files will be overwritten if you update WPAdverts to latest version.