• Resolved Flo

    (@flow31)


    Hi,

    Thanks for your plugin !

    1/ How can i change category select from multiple choice to unique choice ?
    2/ I would like to skip the preview page, the form directly save data with confirmation message
    3/ How can i disable tiny mce for post-content ?

    Thanks a lot !

    https://wordpress.org/plugins/wpadverts/

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

    (@gwin)

    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 ?

    Plugin Author Greg Winiarski

    (@gwin)

    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.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Change field and process’ is closed to new replies.