PHP Class Jetpack_Portfolio, jetpack

ファイルを表示 Open project: automattic/jetpack

Public Properties

Property Type Description
$version

Public Methods

Method 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 method

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

activation_post_type_support() static public method

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

add_to_sitemap() public method

Add CPT to Dotcom sitemap
public add_to_sitemap ( $post_types )

allow_portfolio_rest_api_type() public method

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

customize_register() public method

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

deactivation_post_type_support() public method

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

edit_admin_columns() public method

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

enqueue_admin_styles() public method

Adjust image column width
public enqueue_admin_styles ( $hook )

flush_rules_on_enable() public method

* Flush permalinks when CPT option is turned on/off

flush_rules_on_first_project() public method

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

flush_rules_on_switch() public method

* Flush permalinks when CPT supported theme is activated

get_project_author() static public method

Displays the author of the current portfolio project.
static public get_project_author ( ) : html
return html

get_project_class() static public method

Individual project class
static public get_project_class ( $portfolio_index_number, $columns ) : string
return string

get_project_tags() static public method

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

get_project_type() static public method

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

image_column() public method

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

init() static public method

static public init ( )

portfolio_query() static public method

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

portfolio_shortcode() static public method

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

portfolio_shortcode_html() static public method

The Portfolio shortcode loop.
static public portfolio_shortcode_html ( $atts ) : html
return html

query_reading_setting() public method

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

register_post_types() public method

Register Post Type
public register_post_types ( )

setting_html() public method

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

settings_api_init() public method

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

site_supports_custom_post_type() public method

Should this Custom Post Type be made available?

updated_messages() public method

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

Property Details

$version public_oe property

public $version