PHP Class WC_Admin_Post_Types

Handles the edit posts views and some functionality on the edit post screen for WC post types.
Afficher le fichier Open project: woocommerce/woocommerce Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( ) Constructor.
add_custom_query_var ( mixed $public_query_vars ) : array Query vars for custom searches.
bulk_action ( ) Process the new bulk actions for changing order status.
bulk_admin_footer ( ) Add extra bulk action options to mark orders as complete or processing.
bulk_admin_notices ( ) Show confirmation message that order status changed for number of orders.
bulk_and_quick_edit_hook ( integer $post_id, object $post ) Offers a way to hook into save post without causing an infinite loop when quick/bulk saving product info.
bulk_and_quick_edit_save_post ( integer $post_id, WP_Post $post ) : integer Quick and bulk edit saving.
bulk_edit ( mixed $column_name, mixed $post_type ) Custom bulk edit - form.
bulk_edit_save ( integer $post_id, WC_Product $product ) Bulk edit.
bulk_post_updated_messages ( array $bulk_messages, array $bulk_counts ) : array Specify custom bulk actions messages for different post types.
disable_autosave ( ) Disable the auto-save functionality for Orders.
disable_dfw_feature_pointer ( ) Disable DFW feature pointer.
disable_view_mode_options ( array $post_types ) : array Removes products, orders, and coupons from the list of post types that support "View Mode" switching.
edit_form_after_title ( WP_Post $post ) Print coupon description textarea field.
enter_title_here ( string $text, object $post ) : string Change title boxes in admin.
handle_shop_order_bulk_actions ( string $redirect_to, string $action, array $ids ) : string Handle shop order bulk actions.
hidden_meta_boxes ( array $hidden, object $screen ) : array Hidden default Meta-Boxes.
hide_cpt_archive_templates ( $page_templates, $class, $post ) : array When editing the shop page, we should hide templates.
list_table_primary_column ( string $default, string $screen_id ) : string Set list table primary column for products and orders.
maybe_render_blank_state ( $which ) Show blank slate.
post_updated_messages ( array $messages ) : array Change messages when a post type is updated.
process_product_file_download_paths ( integer $product_id, integer $variation_id, array $downloadable_files ) Grant downloadable file access to any newly added files on any existing.
product_columns ( array $existing_columns ) : array Define custom columns for products.
product_data_visibility ( ) Output product visibility options.
product_filters ( ) Show a category filter box.
product_filters_query ( mixed $query ) Filter the products in admin based on options.
product_search ( string $where ) : string Search by SKU or ID for products.
product_sortable_columns ( array $columns ) : array Make columns sortable - https://gist.github.com/906872.
product_sorting_link ( array $views ) : array Product sorting link.
quick_edit ( mixed $column_name, mixed $post_type ) Custom quick edit - form.
render_product_columns ( string $column ) Ouput custom columns for products.
render_shop_coupon_columns ( string $column ) Output custom columns for coupons.
render_shop_order_columns ( string $column ) Output custom columns for coupons.
request_query ( array $vars ) : array Filters and sorting handler.
restrict_manage_posts ( ) Filters for post types.
row_actions ( array $actions, WP_Post $post ) : array Set row actions for products and orders.
shop_coupon_columns ( array $existing_columns ) : array Define custom columns for coupons.
shop_coupon_filters ( ) Show custom filters to filter coupons by type.
shop_coupon_sortable_columns ( array $columns ) : array Make columns sortable - https://gist.github.com/906872.
shop_order_bulk_actions ( array $actions ) : array Manipulate shop order bulk actions.
shop_order_columns ( array $existing_columns ) : array Define custom columns for orders.
shop_order_filters ( ) Show custom filters to filter orders by status/customer.
shop_order_search_custom_fields ( WP_Query $wp ) Search custom fields as well as content.
shop_order_search_label ( mixed $query ) : string Change the label when searching orders.
shop_order_sortable_columns ( array $columns ) : array Make columns sortable - https://gist.github.com/906872.
show_cpt_archive_notice ( $post ) Show a notice above the CPT archive.
upload_dir ( array $pathdata ) : array Filter the directory for uploads.
woocommerce_media_upload_downloadable_product ( ) Run a filter when uploading a downloadable product.

Private Methods

Méthode Description
quick_edit_save ( integer $post_id, WC_Product $product ) Quick edit.

Method Details

__construct() public méthode

Constructor.
public __construct ( )

add_custom_query_var() public méthode

Query vars for custom searches.
public add_custom_query_var ( mixed $public_query_vars ) : array
$public_query_vars mixed
Résultat array

bulk_action() public méthode

Process the new bulk actions for changing order status.
public bulk_action ( )

bulk_admin_notices() public méthode

Show confirmation message that order status changed for number of orders.
public bulk_admin_notices ( )

bulk_and_quick_edit_hook() public méthode

Offers a way to hook into save post without causing an infinite loop when quick/bulk saving product info.
Since: 2.7.0
public bulk_and_quick_edit_hook ( integer $post_id, object $post )
$post_id integer
$post object

bulk_and_quick_edit_save_post() public méthode

Quick and bulk edit saving.
public bulk_and_quick_edit_save_post ( integer $post_id, WP_Post $post ) : integer
$post_id integer
$post WP_Post
Résultat integer

bulk_edit() public méthode

Custom bulk edit - form.
public bulk_edit ( mixed $column_name, mixed $post_type )
$column_name mixed
$post_type mixed

bulk_edit_save() public méthode

Bulk edit.
public bulk_edit_save ( integer $post_id, WC_Product $product )
$post_id integer
$product WC_Product

bulk_post_updated_messages() public méthode

Specify custom bulk actions messages for different post types.
public bulk_post_updated_messages ( array $bulk_messages, array $bulk_counts ) : array
$bulk_messages array
$bulk_counts array
Résultat array

disable_autosave() public méthode

Disable the auto-save functionality for Orders.
public disable_autosave ( )

disable_dfw_feature_pointer() public méthode

Disable DFW feature pointer.

disable_view_mode_options() public méthode

View mode is seen on posts where you can switch between list or excerpt. Our post types don't support it, so we want to hide the useless UI from the screen options tab.
Since: 2.6
public disable_view_mode_options ( array $post_types ) : array
$post_types array Array of post types supporting view mode
Résultat array Array of post types supporting view mode, without products, orders, and coupons

edit_form_after_title() public méthode

Print coupon description textarea field.
public edit_form_after_title ( WP_Post $post )
$post WP_Post

enter_title_here() public méthode

Change title boxes in admin.
public enter_title_here ( string $text, object $post ) : string
$text string
$post object
Résultat string

handle_shop_order_bulk_actions() public méthode

Handle shop order bulk actions.
Since: 2.7.0
public handle_shop_order_bulk_actions ( string $redirect_to, string $action, array $ids ) : string
$redirect_to string URL to redirect to.
$action string Action name.
$ids array List of ids.
Résultat string

hidden_meta_boxes() public méthode

Hidden default Meta-Boxes.
public hidden_meta_boxes ( array $hidden, object $screen ) : array
$hidden array
$screen object
Résultat array

hide_cpt_archive_templates() public méthode

When editing the shop page, we should hide templates.
public hide_cpt_archive_templates ( $page_templates, $class, $post ) : array
Résultat array

list_table_primary_column() public méthode

Support for WordPress 4.3.
public list_table_primary_column ( string $default, string $screen_id ) : string
$default string
$screen_id string
Résultat string

maybe_render_blank_state() public méthode

Show blank slate.
public maybe_render_blank_state ( $which )

post_updated_messages() public méthode

Change messages when a post type is updated.
public post_updated_messages ( array $messages ) : array
$messages array
Résultat array

process_product_file_download_paths() public méthode

orders for this product that have previously been granted downloadable file access.
Deprecation: and moved to post-data class.
public process_product_file_download_paths ( integer $product_id, integer $variation_id, array $downloadable_files )
$product_id integer product identifier
$variation_id integer optional product variation identifier
$downloadable_files array newly set files

product_columns() public méthode

Define custom columns for products.
public product_columns ( array $existing_columns ) : array
$existing_columns array
Résultat array

product_data_visibility() public méthode

Output product visibility options.

product_filters() public méthode

Show a category filter box.
public product_filters ( )

product_filters_query() public méthode

Filter the products in admin based on options.
public product_filters_query ( mixed $query )
$query mixed

product_sortable_columns() public méthode

Make columns sortable - https://gist.github.com/906872.
public product_sortable_columns ( array $columns ) : array
$columns array
Résultat array

quick_edit() public méthode

Custom quick edit - form.
public quick_edit ( mixed $column_name, mixed $post_type )
$column_name mixed
$post_type mixed

render_product_columns() public méthode

Ouput custom columns for products.
public render_product_columns ( string $column )
$column string

render_shop_coupon_columns() public méthode

Output custom columns for coupons.
public render_shop_coupon_columns ( string $column )
$column string

render_shop_order_columns() public méthode

Output custom columns for coupons.
public render_shop_order_columns ( string $column )
$column string

request_query() public méthode

Filters and sorting handler.
public request_query ( array $vars ) : array
$vars array
Résultat array

restrict_manage_posts() public méthode

Filters for post types.

row_actions() public méthode

Set row actions for products and orders.
public row_actions ( array $actions, WP_Post $post ) : array
$actions array
$post WP_Post
Résultat array

shop_coupon_columns() public méthode

Define custom columns for coupons.
public shop_coupon_columns ( array $existing_columns ) : array
$existing_columns array
Résultat array

shop_coupon_filters() public méthode

Show custom filters to filter coupons by type.
public shop_coupon_filters ( )

shop_coupon_sortable_columns() public méthode

Make columns sortable - https://gist.github.com/906872.
public shop_coupon_sortable_columns ( array $columns ) : array
$columns array
Résultat array

shop_order_bulk_actions() public méthode

Manipulate shop order bulk actions.
public shop_order_bulk_actions ( array $actions ) : array
$actions array List of actions.
Résultat array

shop_order_columns() public méthode

Define custom columns for orders.
public shop_order_columns ( array $existing_columns ) : array
$existing_columns array
Résultat array

shop_order_filters() public méthode

Show custom filters to filter orders by status/customer.
public shop_order_filters ( )

shop_order_search_custom_fields() public méthode

Search custom fields as well as content.
public shop_order_search_custom_fields ( WP_Query $wp )
$wp WP_Query

shop_order_search_label() public méthode

Change the label when searching orders.
public shop_order_search_label ( mixed $query ) : string
$query mixed
Résultat string

shop_order_sortable_columns() public méthode

Make columns sortable - https://gist.github.com/906872.
public shop_order_sortable_columns ( array $columns ) : array
$columns array
Résultat array

show_cpt_archive_notice() public méthode

Show a notice above the CPT archive.
public show_cpt_archive_notice ( $post )

upload_dir() public méthode

Filter the directory for uploads.
public upload_dir ( array $pathdata ) : array
$pathdata array
Résultat array

woocommerce_media_upload_downloadable_product() public méthode

Run a filter when uploading a downloadable product.