get_content example


    public function to_json() {
        $this->json['settings'] = array();
        foreach ( $this->settings as $key => $setting ) {
            $this->json['settings'][ $key ] = $setting->id;
        }

        $this->json['type']           = $this->type;
        $this->json['priority']       = $this->priority;
        $this->json['active']         = $this->active();
        $this->json['section']        = $this->section;
        $this->json['content']        = $this->get_content();
        $this->json['label']          = $this->label;
        $this->json['description']    = $this->description;
        $this->json['instanceNumber'] = $this->instance_number;

        if ( 'dropdown-pages' === $this->type ) {
            $this->json['allow_addition'] = $this->allow_addition;
        }
    }

    /** * Get the data to export to the client via JSON. * * @since 4.1.0 * * @return array Array of parameters passed to the JavaScript. */
/** * Gather the parameters passed to client JavaScript via JSON. * * @since 4.1.0 * * @return array The array to be exported to the client as JSON. */
    public function json() {
        $array                          = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'type' ) );
        $array['title']                 = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
        $array['content']               = $this->get_content();
        $array['active']                = $this->active();
        $array['instanceNumber']        = $this->instance_number;
        $array['autoExpandSoleSection'] = $this->auto_expand_sole_section;
        return $array;
    }

    /** * Checks required user capabilities and whether the theme has the * feature support required by the panel. * * @since 4.0.0 * @since 5.9.0 Method was marked non-final. * * @return bool False if theme doesn't support the panel or the user doesn't have the capability. */

        if ($fn === false)
        {
            return null;
        }
        elseif (!is_callable($fn))
        {
            trigger_error('User-supplied function $fn must be callable', E_USER_WARNING);
            $fn = 'md5';
        }
        return call_user_func($fn,
               $this->get_permalink().$this->get_title().$this->get_content());
    }

    /** * Get the title of the item * * Uses `<atom:title>`, `<title>` or `<dc:title>` * * @since Beta 2 (previously called `get_item_title` since 0.8) * @return string|null */
    public function get_title()
    {
/** * Gather the parameters passed to client JavaScript via JSON. * * @since 4.1.0 * * @return array The array to be exported to the client as JSON. */
    public function json() {
        $array                   = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'panel', 'type', 'description_hidden' ) );
        $array['title']          = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) );
        $array['content']        = $this->get_content();
        $array['active']         = $this->active();
        $array['instanceNumber'] = $this->instance_number;

        if ( $this->panel ) {
            /* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */
            $array['customizeAction'] = sprintf( __( 'Customizing &#9656; %s' )esc_html( $this->manager->get_panel( $this->panel )->title ) );
        } else {
            $array['customizeAction'] = __( 'Customizing' );
        }

        return $array;
    }
Home | Imprint | This part of the site doesn't use cookies.