* @license GPL-2.0+ * @link http://www.contentviewspro.com/ * @copyright 2014 PT Guy */ // Check if using Wordpress version 3.7 or higher $version_gt_37 = PT_CV_Functions::wp_version_compare( '3.7' ); $settings = array(); $id = 0; $post_id = apply_filters( PT_CV_PREFIX_ . 'view_post_id', 0 ); // Check if this is edit View page if ( !empty( $_GET[ 'id' ] ) ) { $id = cv_sanitize_vid( $_GET[ 'id' ] ); if ( $id ) { global $pt_cv_admin_settings; $pt_cv_admin_settings = $settings = PT_CV_Functions::view_get_settings( $id, $post_id ); } } // Submit handle PT_CV_Functions::view_submit(); ?>

For page content, text widget...
For theme file
get Pro version', $id ) ?>
array( 'text' => __( 'Preview' ), ), 'params' => array( array( 'type' => 'html', 'name' => 'preview', 'content' => PT_CV_Html::html_preview_box(), 'desc' => sprintf( __( 'To see live output, please click %s button', 'content-views-query-and-display-post-page' ), sprintf( '%s', __( 'Show Preview', 'content-views-query-and-display-post-page' ) ) ), ), ), ), ); echo PT_Options_Framework::do_settings( $options, $settings ); ?>

array( 'text' => __( 'Title' ), ), 'params' => array( array( 'type' => 'text', 'name' => 'view-title', 'std' => isset( $view_object->post_title ) ? $view_object->post_title : '', 'desc' => __( 'Enter a name to identify your views easily', 'content-views-query-and-display-post-page' ), ), ), ), ); echo PT_Options_Framework::do_settings( $options, $settings ); ?>
array( 'text' => __( 'Content type', 'content-views-query-and-display-post-page' ), ), 'params' => array( apply_filters( PT_CV_PREFIX_ . 'contenttype_setting', array( 'type' => 'radio', 'name' => 'content-type', 'options' => PT_CV_Values::post_types(), 'std' => 'post', ) ), ), ), // Upgrade to Pro: Custom post type !get_option( 'pt_cv_version_pro' ) ? PT_CV_Settings::get_cvpro( __( 'Filter custom post type (product, event...)', 'content-views-query-and-display-post-page' ) ) : '', apply_filters( PT_CV_PREFIX_ . 'custom_filters', array() ), // Common Filters array( 'label' => array( 'text' => __( 'Common', 'content-views-query-and-display-post-page' ), ), 'extra_setting' => array( 'params' => array( 'wrap-class' => PT_CV_Html::html_group_class(), ), ), 'params' => array( array( 'type' => 'group', 'params' => array( apply_filters( PT_CV_PREFIX_ . 'sticky_posts_setting', array() ), // Includes array( 'label' => array( 'text' => __( 'Include only', 'content-views-query-and-display-post-page' ), ), 'params' => array( array( 'type' => 'text', 'name' => 'post__in', 'std' => '', 'desc' => apply_filters( PT_CV_PREFIX_ . 'setting_post_in', __( 'List of post IDs to show (comma-separated values, for example: 1,2,3)', 'content-views-query-and-display-post-page' ) ), ), ), ), apply_filters( PT_CV_PREFIX_ . 'include_extra_settings', array() ), // Excludes array( 'label' => array( 'text' => __( 'Exclude', 'content-views-query-and-display-post-page' ), ), 'params' => array( array( 'type' => 'text', 'name' => 'post__not_in', 'std' => '', 'desc' => apply_filters( PT_CV_PREFIX_ . 'setting_post_not_in', __( 'List of post IDs to exclude (comma-separated values, for example: 1,2,3)', 'content-views-query-and-display-post-page' ) ), ), ), 'dependence' => array( 'post__in', '' ), ), apply_filters( PT_CV_PREFIX_ . 'exclude_extra_settings', array() ), // Parent page array( 'label' => array( 'text' => __( 'Parent page', 'content-views-query-and-display-post-page' ), ), 'params' => array( array( 'type' => 'number', 'name' => 'post_parent', 'std' => '', 'desc' => apply_filters( PT_CV_PREFIX_ . 'setting_parent_page', __( 'Enter ID of parent page to show its children', 'content-views-query-and-display-post-page' ) ), ), ), 'dependence' => array( 'content-type', 'page' ), ), apply_filters( PT_CV_PREFIX_ . 'post_parent_settings', array() ), // Limit array( 'label' => array( 'text' => __( 'Limit', 'content-views-query-and-display-post-page' ), ), 'params' => array( array( 'type' => 'number', 'name' => 'limit', 'std' => '10', 'min' => '1', 'desc' => __( 'The number of posts to show. Leave empty to show all found posts', 'content-views-query-and-display-post-page' ), ), ), ), apply_filters( PT_CV_PREFIX_ . 'after_limit_option', '' ), ), ), ), ), // End Common Filters // Advanced Filters array( 'label' => array( 'text' => __( 'Advance', 'content-views-query-and-display-post-page' ), ), 'extra_setting' => array( 'params' => array( 'wrap-class' => PT_CV_Html::html_group_class(), 'wrap-id' => PT_CV_Html::html_group_id( 'advanced-params' ), ), ), 'params' => array( array( 'type' => 'group', 'params' => array( array( 'label' => array( 'text' => '', ), 'extra_setting' => array( 'params' => array( 'width' => 12, ), ), 'params' => array( array( 'type' => 'checkbox', 'name' => 'advanced-settings[]', 'options' => PT_CV_Values::advanced_settings(), 'std' => '', 'class' => 'advanced-settings-item', ), ), ), ), ), ), ), // End Advanced Filters // Settings of Advanced Filters options array( 'label' => array( 'text' => '', ), 'extra_setting' => array( 'params' => array( 'wrap-class' => PT_CV_Html::html_panel_group_class(), 'wrap-id' => PT_CV_Html::html_panel_group_id( PT_CV_Functions::string_random() ), ), ), 'params' => array( array( 'type' => 'panel_group', 'params' => apply_filters( PT_CV_PREFIX_ . 'advanced_settings_panel', array( // Taxonomies Settings 'taxonomy' => array( 'parent_label' => sprintf( __( 'Filter by %s', 'content-views-query-and-display-post-page' ), __( 'Taxonomy', 'content-views-query-and-display-post-page' ) ), // Taxonomies list array( 'label' => array( 'text' => __( 'Select taxonomy', 'content-views-query-and-display-post-page' ), ), 'extra_setting' => array( 'params' => array( 'wrap-class' => PT_CV_PREFIX . 'taxonomies', ), ), 'params' => array( array( 'type' => 'checkbox', 'name' => 'taxonomy[]', 'options' => PT_CV_Values::taxonomy_list(), 'std' => '', 'class' => 'taxonomy-item', ), ), ), // Upgrade to Pro: Custom taxonomy !get_option( 'pt_cv_version_pro' ) ? PT_CV_Settings::get_cvpro( __( 'Filter by custom taxonomies', 'content-views-query-and-display-post-page' ) ) : '', // Terms list array( 'label' => array( 'text' => '', ), 'extra_setting' => array( 'params' => array( 'wrap-class' => PT_CV_Html::html_panel_group_class() . ' terms', 'wrap-id' => PT_CV_Html::html_panel_group_id( PT_CV_Functions::string_random() ), ), ), 'params' => array( array( 'type' => 'panel_group', 'settings' => array( 'nice_name' => PT_CV_Values::taxonomy_list(), ), 'params' => PT_CV_Settings::terms_of_taxonomies(), ), ), ), // Relation of taxonomies array( 'label' => array( 'text' => __( 'Relation', 'content-views-query-and-display-post-page' ), ), 'params' => array( array( 'type' => 'select', 'name' => 'taxonomy-relation', 'options' => PT_CV_Values::taxonomy_relation(), 'std' => PT_CV_Functions::array_get_first_key( PT_CV_Values::taxonomy_relation() ), 'class' => 'taxonomy-relation', 'desc' => __( 'The logical relationship between above taxonomies', 'content-views-query-and-display-post-page' ), ), ), ), !get_option( 'pt_cv_version_pro' ) ? PT_CV_Settings::get_cvpro( sprintf( __( 'In this lite version, when you select any term above, it will not replace posts layout in term page (for example: %s) with layout of this View', 'content-views-query-and-display-post-page' ), 'http://yourdomain/category/selected_term/' ), 12, null, true ) : '', apply_filters( PT_CV_PREFIX_ . 'taxonomies_custom_settings', array() ), ), // End Taxonomies Settings // Sort by Settings 'order' => array( 'parent_label' => __( 'Sort by', 'content-views-query-and-display-post-page' ), array( 'label' => array( 'text' => __( 'Sort by', 'content-views-query-and-display-post-page' ), ), 'extra_setting' => array( 'params' => array( 'width' => 12, ), ), 'params' => array( array( 'type' => 'panel_group', 'settings' => array( 'show_all' => 1, ), 'params' => PT_CV_Settings::orderby(), ), ), ), ), // End Order by Settings // Author Settings 'author' => apply_filters( PT_CV_PREFIX_ . 'author_settings', array( 'parent_label' => sprintf( __( 'Filter by %s', 'content-views-query-and-display-post-page' ), __( 'Author' ) ), array( 'label' => array( 'text' => __( 'By author', 'content-views-query-and-display-post-page' ), ), 'params' => array( array( 'type' => 'select', 'name' => 'author__in[]', 'options' => PT_CV_Values::user_list(), 'std' => '', 'class' => 'select2', 'multiple' => $version_gt_37 ? '1' : '0', ), ), ), $version_gt_37 ? array( 'label' => array( 'text' => __( 'Not by author', 'content-views-query-and-display-post-page' ), ), 'params' => array( array( 'type' => 'select', 'name' => 'author__not_in[]', 'options' => PT_CV_Values::user_list(), 'std' => '', 'class' => 'select2', 'multiple' => $version_gt_37 ? '1' : '0', ), ), ) : array(), ) ), // End Author Settings // Status Settings 'status' => array( 'parent_label' => sprintf( __( 'Filter by %s', 'content-views-query-and-display-post-page' ), __( 'Status' ) ), array( 'label' => array( 'text' => '', ), 'extra_setting' => array( 'params' => array( 'width' => 12, ), ), 'params' => array( array( 'type' => 'select', 'name' => 'post_status', 'options' => PT_CV_Values::post_statuses(), 'std' => 'publish', 'class' => 'select2', 'multiple' => '1', 'desc' => __( 'Select post status', 'content-views-query-and-display-post-page' ), ), ), ), ), // End Status Settings // Keyword Settings 'search' => array( 'parent_label' => sprintf( __( 'Filter by %s', 'content-views-query-and-display-post-page' ), __( 'Keyword' ) ), array( 'label' => array( 'text' => '', ), 'extra_setting' => array( 'params' => array( 'width' => 12, ), ), 'params' => array( array( 'type' => 'text', 'name' => 's', 'std' => '', 'desc' => __( 'Enter keyword to searching for posts', 'content-views-query-and-display-post-page' ) . apply_filters( PT_CV_PREFIX_ . 'searchby_keyword_desc', '' ) . '
' . __( 'It will search keyword in title, excerpt, content of posts', 'content-views-query-and-display-post-page' ), ), ), ), ), // End Keyword Settings ) ), ), ), ), ); echo PT_Options_Framework::do_settings( $options, $settings ); ?>
array( 'text' => __( 'Layout', 'content-views-query-and-display-post-page' ), ), 'params' => array( apply_filters( PT_CV_PREFIX_ . 'viewtype_setting', array( 'type' => 'radio', 'name' => 'view-type', 'options' => PT_CV_Values::view_type(), 'std' => PT_CV_Functions::array_get_first_key( PT_CV_Values::view_type() ), ) ), ), ), // View settings array( 'label' => array( 'text' => '', ), 'params' => array( array( 'type' => 'panel_group', 'settings' => array( 'no_panel' => 1, 'show_only_one' => 1, ), 'params' => PT_CV_Values::view_type_settings(), ), ), ), !get_option( 'pt_cv_version_pro' ) ? PT_CV_Settings::get_cvpro( __( 'More amazing layouts (Pinterest, Timeline...)', 'content-views-query-and-display-post-page' ), 10, 'margin-bottom:10px' ) : '', apply_filters( PT_CV_PREFIX_ . 'more_responsive_settings', array( 'label' => array( 'text' => __( 'Responsive', 'content-views-query-and-display-post-page' ), ), 'params' => array( array( 'type' => 'group', 'params' => array( array( 'label' => array( 'text' => sprintf( '%s (%s)', __( 'Items per row', 'content-views-query-and-display-post-page' ), __( 'Tablet', 'content-views-query-and-display-post-page' ) ), ), 'params' => array( array( 'type' => 'number', 'name' => 'resp-tablet-number-columns', 'std' => '2', 'append_text' => '1 → 4', ), ), ), array( 'label' => array( 'text' => sprintf( '%s (%s)', __( 'Items per row', 'content-views-query-and-display-post-page' ), __( 'Mobile', 'content-views-query-and-display-post-page' ) ), ), 'params' => array( array( 'type' => 'number', 'name' => 'resp-number-columns', 'std' => '1', 'append_text' => '1 → 4', ), ), ), ), ), ), 'dependence' => array( 'view-type', !get_option( 'pt_cv_version_pro' ) ? array( 'grid' ) : array( 'grid', 'scrollable', 'pinterest', 'glossary' ) ), ) ), array( 'label' => array( 'text' => __( 'Format', 'content-views-query-and-display-post-page' ), ), 'extra_setting' => array( 'params' => array( 'wrap-class' => PT_CV_Html::html_group_class(), ), ), 'params' => array( array( 'type' => 'group', 'params' => array( array( 'label' => array( 'text' => '', ), 'extra_setting' => array( 'params' => array( 'width' => 12, ), ), 'params' => array( array( 'type' => 'radio', 'name' => 'layout-format', 'options' => PT_CV_Values::layout_format(), 'std' => PT_CV_Functions::array_get_first_key( PT_CV_Values::layout_format() ), ), ), ), array( 'label' => array( 'text' => '', ), 'extra_setting' => array( 'params' => array( 'width' => 12, ), ), 'params' => array( array( 'type' => 'checkbox', 'name' => 'lf-mobile-disable', 'options' => PT_CV_Values::yes_no( 'yes', __( 'Disable this format on small screens (less than 481 pixels)', 'content-views-query-and-display-post-page' ) ), 'std' => '', ), ), 'dependence' => array( 'layout-format', '2-col' ), ), ), ), ), ), // Fields settings array( 'label' => array( 'text' => __( 'Fields settings', 'content-views-query-and-display-post-page' ), ), 'extra_setting' => array( 'params' => array( 'wrap-class' => PT_CV_Html::html_group_class(), 'wrap-id' => PT_CV_Html::html_group_id( 'field-settings' ), ), ), 'params' => array( array( 'type' => 'group', 'params' => PT_CV_Settings::field_settings(), ), ), ), // Pagination settings array( 'label' => array( 'text' => __( 'Pagination', 'content-views-query-and-display-post-page' ), ), 'extra_setting' => array( 'params' => array( 'wrap-class' => PT_CV_Html::html_group_class(), ), ), 'params' => array( array( 'type' => 'group', 'params' => PT_CV_Settings::settings_pagination(), ), ), ), // Other settings array( 'label' => array( 'text' => __( 'Others', 'content-views-query-and-display-post-page' ), ), 'extra_setting' => array( 'params' => array( 'wrap-class' => PT_CV_Html::html_group_class(), ), ), 'params' => array( array( 'type' => 'group', 'params' => PT_CV_Settings::settings_other(), ), ), ), ); $options = apply_filters( PT_CV_PREFIX_ . 'display_settings', $options ); echo PT_Options_Framework::do_settings( $options, $settings ); ?>