Plugin Directory

Changeset 1711592


Ignore:
Timestamp:
08/10/2017 03:25:45 PM (9 years ago)
Author:
shahalom
Message:

Disable Rich Editor for Ad Post Type in Monetize Me plugin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • monetize-me/trunk/inc/custom-post-types/ad.php

    r1709597 r1711592  
    1515        //
    1616        add_action('init', array($this, 'create_custom_post_type'));
     17
     18        // Disable Rich Editor for Ad Post Type
     19        add_filter( 'user_can_richedit', array($this, 'disable_for_cpt') );
     20    }
     21
     22    /**
     23     *
     24     */
     25    function disable_for_cpt( $default ) {
     26        global $post;
     27
     28        if ($this->post_type == get_post_type( $post ))
     29            return false;
     30
     31        return $default;
    1732    }
    1833
Note: See TracChangeset for help on using the changeset viewer.