array( 'label' => __( 'Settings', 'pagination' ) ), 'misc' => array( 'label' => __( 'Misc', 'pagination' ) ), 'custom_code' => array( 'label' => __( 'Custom Code', 'pagination' ) ), 'license' => array( 'label' => __( 'License Key', 'pagination' ) ) ); parent::__construct( array( 'plugin_basename' => $plugin_basename, 'plugins_info' => $pgntn_plugin_info, 'prefix' => 'pgntn', 'default_options' => pgntn_get_options_default(), 'options' => $pgntn_options, 'is_network_options'=> is_network_admin(), 'tabs' => $tabs, 'wp_slug' => 'pagination', 'doc_link' => 'https://docs.google.com/document/d/1r02_D7mbbTxmXPSKmoHGh87Y5QBzrv9_ga7boWM_PN4/edit', 'pro_page' => 'admin.php?page=pagination-pro.php', 'bws_license_plugin'=> 'pagination-pro/pagination-pro.php', 'link_key' => '5f3235c93ef4bd001abe4efd16530be0', 'link_pn' => '212' ) ); add_action( get_parent_class( $this ) . '_display_metabox', array( $this, 'display_metabox' ) ); } /** * Save plugin options to the database * @access public * @param void * @return array The action results */ public function save_options() { global $wpdb; $message = $notice = $error = ''; $array_classes = array(); $plugin_basename = plugin_basename( __FILE__ ); if ( isset( $_REQUEST['pgntn_where_display'] ) ) { $this->options['where_display'] = array(); foreach( $_REQUEST['pgntn_where_display'] as $this->position ) { $this->options['where_display'][] = $this->position; } } else { $this->options['where_display'] = array(); } if ( isset( $_REQUEST['pgntn_display_standard_pagination'] ) ) { $this->options['display_standard_pagination'] = array(); foreach( $_REQUEST['pgntn_display_standard_pagination'] as $this->position ) $this->options['display_standard_pagination'][] = $this->position; } else { $this->options['display_standard_pagination'] = array(); } $this->options['loop_position'] = isset( $_REQUEST['pgntn_loop_position'] ) && in_array( $_REQUEST['pgntn_loop_position'], array( 'top', 'bottom', 'both', 'function' ) ) ? $_REQUEST['pgntn_loop_position'] : 'bottom'; $this->options['display_count_page'] = isset( $_REQUEST['pgntn_display_count_page'] ) ? intval( $_REQUEST['pgntn_display_count_page'] ) : $this->options['display_count_page']; $this->options['show_all'] = 0 >= $this->options['display_count_page'] ? 1 : 0; $this->options['display_info'] = isset( $_REQUEST['pgntn_display_info'] ) ? 1 : 0; $this->options['display_next_prev'] = isset( $_REQUEST['pgntn_display_next_prev'] ) ? 1 : 0; $this->options['prev_text'] = isset( $_REQUEST['pgntn_prev_text'] ) ? stripslashes( sanitize_text_field( $_REQUEST['pgntn_prev_text'] ) ) : $this->options['prev_text']; $this->options['next_text'] = isset( $_REQUEST['pgntn_next_text'] ) ? stripslashes( sanitize_text_field( $_REQUEST['pgntn_next_text'] ) ) : $this->options['next_text']; $this->options['additional_pagination_style'] = isset( $_REQUEST['pgntn_additional_pagination_style'] ) ? stripslashes( sanitize_text_field( $_REQUEST ['pgntn_additional_pagination_style'] ) ) : $this->options['additional_pagination_style']; $this->options['display_custom_pagination'] = isset( $_REQUEST['pgntn_display_custom_pagination'] ) ? 1 : 0; $this->options['padding_left'] = isset( $_REQUEST['pgntn_padding_left'] ) ? intval( $_REQUEST['pgntn_padding_left'] ) : $this->options['padding_left']; $this->options['padding_right'] = isset( $_REQUEST['pgntn_padding_right'] ) ? intval( $_REQUEST['pgntn_padding_right'] ) : $this->options['padding_right']; $this->options['nofollow_link'] = isset( $_REQUEST['pgntn_nofollow_attribute'] ) ? 1 : 0; $this->options['add_appearance'] = isset( $_REQUEST['pgntn_add_appearance'] ) ? 1 : 0; if ( $this->options['add_appearance'] ) { $this->options['width'] = isset( $_REQUEST['pgntn_width'] ) ? intval( $_REQUEST['pgntn_width'] ) : $this->options['width']; $this->options['align'] = isset( $_REQUEST['pgntn_align'] ) ? $_REQUEST['pgntn_align'] : $this->options['align']; $this->options['background_color'] = isset( $_REQUEST['pgntn_background_color'] ) && function_exists( 'sanitize_hex_color' ) ? sanitize_hex_color( $_REQUEST['pgntn_background_color'] ) : ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $_REQUEST['pgntn_background_color'] ) ? $_REQUEST['pgntn_background_color'] : $this->options['background_color'] ); $this->options['current_background_color'] = isset( $_REQUEST['pgntn_current_background_color'] ) && function_exists( 'sanitize_hex_color' ) ? sanitize_hex_color( $_REQUEST['pgntn_current_background_color'] ) : ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $_REQUEST['pgntn_current_background_color'] ) ? $_REQUEST['pgntn_current_background_color'] : $this->options['current_background_color'] ); $this->options['text_color'] = isset( $_REQUEST['pgntn_text_color'] ) && function_exists( 'sanitize_hex_color' ) ? sanitize_hex_color( $_REQUEST['pgntn_text_color'] ) : ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $_REQUEST['pgntn_text_color'] ) ? $_REQUEST['pgntn_text_color'] : $this->options['text_color'] ); $this->options['current_text_color'] = isset( $_REQUEST['pgntn_current_text_color'] ) && function_exists( 'sanitize_hex_color' ) ? sanitize_hex_color( $_REQUEST['pgntn_current_text_color'] ) : ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $_REQUEST['pgntn_current_text_color'] ) ? $_REQUEST['pgntn_current_text_color'] : $this->options['current_text_color'] ); $this->options['border_color'] = isset( $_REQUEST['pgntn_border_color'] ) && function_exists( 'sanitize_hex_color' ) ? sanitize_hex_color( $_REQUEST['pgntn_border_color'] ) : ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $_REQUEST['pgntn_border_color'] ) ? $_REQUEST['pgntn_border_color'] : $this->options['border_color'] ); $this->options['hover_color'] = isset( $_REQUEST['pgntn_hover_color'] ) && function_exists( 'sanitize_hex_color' ) ? sanitize_hex_color( $_REQUEST['pgntn_hover_color'] ) : ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $_REQUEST['pgntn_hover_color'] ) ? $_REQUEST['pgntn_hover_color'] : $this->options['hover_color'] ); $this->options['border_width'] = isset( $_REQUEST['pgntn_border_width'] ) ? intval( $_REQUEST['pgntn_border_width'] ) : $this->options['border_width']; $this->options['border_radius'] = isset( $_REQUEST['pgntn_border_radius'] ) ? intval( $_REQUEST['pgntn_border_radius'] ) : $this->options['border_radius']; } if ( empty( $this->options['where_display'] ) ) { $notice = __ ( 'Choose some page types to display plugin`s pagination in frontend of your site.', 'pagination' ); } if ( empty( $notice ) ) { update_option( 'pgntn_options', $this->options ); $message = __( 'Settings saved.', 'pagination' ); } return compact( 'message', 'notice', 'error' ); } public function tab_settings() { global $wp_version; if ( ! $this->all_plugins ) { if ( ! function_exists( 'get_plugins' ) ) { require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); } $this->all_plugins = get_plugins(); } ?>
help_phrase(); ?>| options ['display_info'] ? ' checked="checked"' : ''; ?> /> | |
|
options ['display_next_prev'] ? ' checked="checked"' : ''; ?> />
options ['display_next_prev'] ? 'disabled="disabled"' : ''; ?> name="pgntn_prev_text" id="pgntn_prev_text" /> options ['display_next_prev'] ? 'disabled="disabled"' : ''; ?> name="pgntn_next_text" id="pgntn_next_text" /> |
|
|
options['show_all'] ; ?> id="pgntn_display_count_page" name="pgntn_display_count_page" />
|
| options['add_appearance'] ); ?> name="pgntn_add_appearance" /> | |
| options['add_appearance'], 0 ); ?> />% | |
| options['align'] || 0 == $this->options['add_appearance'] ) ? ' disabled="disabled"': '';?> /> px | |
| options['align'] || 0 == $this->options['add_appearance'] ) ? ' disabled="disabled"': '';?> /> px | |
| options['add_appearance'], 0 ); ?> /> | |
| options['add_appearance'], 0 ); ?> /> | |
| options['add_appearance'], 0 ); ?> /> | |
| options['add_appearance'], 0 ); ?> /> | |
| options['add_appearance'], 0 ); ?> /> | |
| options['add_appearance'], 0 ); ?> /> | |
| options['add_appearance'], 0 ); ?> /> px | |
| options['add_appearance'], 0 ); ?> /> px |
if ( function_exists( 'pgntn_display_pagination' ) ) pgntn_display_pagination( 'posts' );
if ( function_exists( 'pgntn_display_pagination' ) ) pgntn_display_pagination( 'multipage' );
if ( function_exists( 'pgntn_display_pagination' ) ) pgntn_display_pagination( 'comments' );