Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Admin_Popups::sort_columns( array $vars )
Sorts Columns in the List Table
Description Description
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Parameters Parameters
- $vars
-
(Required) Array of all the sort variables
Return Return
(array) $vars Array of all the sort variables
Source Source
File: classes/Admin/Popups.php
public static function sort_columns( $vars ) { // Check if we're viewing the "popup" post type if ( isset( $vars['post_type'] ) && 'popup' == $vars['post_type'] ) { // Check if 'orderby' is set to "name" if ( isset( $vars['orderby'] ) ) { switch ( $vars['orderby'] ) { case 'popup_title': $vars = array_merge( $vars, array( 'meta_key' => 'popup_title', 'orderby' => 'meta_value', ) ); break; case 'opens': if ( ! pum_extension_enabled( 'popup-analytics' ) ) { $vars = array_merge( $vars, array( 'meta_key' => 'popup_open_count', 'orderby' => 'meta_value_num', ) ); } break; case 'conversions': if ( ! pum_extension_enabled( 'popup-analytics' ) ) { $vars = array_merge( $vars, array( 'meta_key' => 'popup_conversion_count', 'orderby' => 'meta_value_num', ) ); } break; } } } return $vars; }
Expand full source code Collapse full source code View on Trac