PHP Class Jetpack_Portfolio, jetpack

Afficher le fichier Open project: automattic/jetpack

Méthodes publiques

Свойство Type Description
$version

Méthodes publiques

Méthode Description
__construct ( ) Conditionally hook into WordPress.
activation_post_type_support ( ) On plugin/theme activation, check if current theme supports CPT
add_to_sitemap ( $post_types ) Add CPT to Dotcom sitemap
allow_portfolio_rest_api_type ( $post_types ) Add to REST API post type whitelist
customize_register ( $wp_customize ) Adds portfolio section to the Customizer.
deactivation_post_type_support ( ) On theme switch, check if CPT item exists and disable if not
edit_admin_columns ( $columns ) Change ‘Title’ column label Add Featured Image column
enqueue_admin_styles ( $hook ) Adjust image column width
flush_rules_on_enable ( ) * Flush permalinks when CPT option is turned on/off
flush_rules_on_first_project ( ) * Count published projects and flush permalinks when first projects is published
flush_rules_on_switch ( ) * Flush permalinks when CPT supported theme is activated
get_portfolio_thumbnail_link ( $post_id ) : html Display the featured image if it's available
get_project_author ( ) : html Displays the author of the current portfolio project.
get_project_class ( $portfolio_index_number, $columns ) : string Individual project class
get_project_tags ( $post_id ) : html Displays the project tags that a project belongs to.
get_project_type ( $post_id ) : html Displays the project type that a project belongs to.
image_column ( $column, $post_id ) Add featured image to column
init ( )
portfolio_query ( $atts ) : object Query to retrieve entries from the Portfolio post_type.
portfolio_shortcode ( $atts ) : portfolio_shortcode_html Our [portfolio] shortcode.
portfolio_shortcode_html ( $atts ) : html The Portfolio shortcode loop.
query_reading_setting ( $query ) Follow CPT reading setting on CPT archive and taxonomy pages
register_post_types ( ) Register Post Type
setting_html ( ) : html HTML code to display a checkbox true/false option for the Portfolio CPT setting.
settings_api_init ( ) : null Add a checkbox field in 'Settings' > 'Writing' for enabling CPT functionality.
site_supports_custom_post_type ( ) Should this Custom Post Type be made available?
updated_messages ( $messages ) Update messages for the Portfolio admin.

Method Details

__construct() public méthode

Setup user option for enabling CPT If user has CPT enabled, show in admin
public __construct ( )

activation_post_type_support() static public méthode

On plugin/theme activation, check if current theme supports CPT
static public activation_post_type_support ( )

add_to_sitemap() public méthode

Add CPT to Dotcom sitemap
public add_to_sitemap ( $post_types )

allow_portfolio_rest_api_type() public méthode

Add to REST API post type whitelist
public allow_portfolio_rest_api_type ( $post_types )

customize_register() public méthode

Adds portfolio section to the Customizer.
public customize_register ( $wp_customize )

deactivation_post_type_support() public méthode

On theme switch, check if CPT item exists and disable if not

edit_admin_columns() public méthode

Change ‘Title’ column label Add Featured Image column
public edit_admin_columns ( $columns )

enqueue_admin_styles() public méthode

Adjust image column width
public enqueue_admin_styles ( $hook )

flush_rules_on_enable() public méthode

* Flush permalinks when CPT option is turned on/off

flush_rules_on_first_project() public méthode

* Count published projects and flush permalinks when first projects is published

flush_rules_on_switch() public méthode

* Flush permalinks when CPT supported theme is activated

get_project_author() static public méthode

Displays the author of the current portfolio project.
static public get_project_author ( ) : html
Résultat html

get_project_class() static public méthode

Individual project class
static public get_project_class ( $portfolio_index_number, $columns ) : string
Résultat string

get_project_tags() static public méthode

Displays the project tags that a project belongs to.
static public get_project_tags ( $post_id ) : html
Résultat html

get_project_type() static public méthode

Displays the project type that a project belongs to.
static public get_project_type ( $post_id ) : html
Résultat html

image_column() public méthode

Add featured image to column
public image_column ( $column, $post_id )

init() static public méthode

static public init ( )

portfolio_query() static public méthode

Query to retrieve entries from the Portfolio post_type.
static public portfolio_query ( $atts ) : object
Résultat object

portfolio_shortcode() static public méthode

Prints Portfolio data styled to look good on *any* theme.
static public portfolio_shortcode ( $atts ) : portfolio_shortcode_html
Résultat portfolio_shortcode_html

portfolio_shortcode_html() static public méthode

The Portfolio shortcode loop.
static public portfolio_shortcode_html ( $atts ) : html
Résultat html

query_reading_setting() public méthode

Follow CPT reading setting on CPT archive and taxonomy pages
public query_reading_setting ( $query )

register_post_types() public méthode

Register Post Type
public register_post_types ( )

setting_html() public méthode

HTML code to display a checkbox true/false option for the Portfolio CPT setting.
public setting_html ( ) : html
Résultat html

settings_api_init() public méthode

Add a checkbox field in 'Settings' > 'Writing' for enabling CPT functionality.
public settings_api_init ( ) : null
Résultat null

site_supports_custom_post_type() public méthode

Should this Custom Post Type be made available?

updated_messages() public méthode

Update messages for the Portfolio admin.
public updated_messages ( $messages )

Property Details

$version public_oe property

public $version