public function prepare()
 {
     // documentation urls
     Types_Helper_Url::load_documentation_urls();
     // set analytics medium
     Types_Helper_Url::set_medium('field_group_editor');
     // add informations
     $this->prepare_informations();
 }
 public function prepare()
 {
     // documentation urls
     $documentation_urls = (include TYPES_DATA . '/information/documentation-urls.php');
     // add links to use analytics
     Types_Helper_Url::add_urls($documentation_urls);
     // set analytics medium
     Types_Helper_Url::set_medium('field_group_editor');
     // add informations
     $this->prepare_informations();
 }
 public function prepare()
 {
     // documentation urls
     Types_Helper_Url::load_documentation_urls();
     // set analytics medium
     Types_Helper_Url::set_medium('post_editor');
     // add information
     $this->prepare_information();
     // @todo load scripts
     if (function_exists('wpcf_edit_post_screen_scripts')) {
         wpcf_edit_post_screen_scripts();
     }
 }
Example #4
0
 public function prepare()
 {
     // documentation urls
     $documentation_urls = (include TYPES_DATA . '/information/documentation-urls.php');
     // add links to use analytics
     Types_Helper_Url::add_urls($documentation_urls);
     // set analytics medium
     Types_Helper_Url::set_medium('post_editor');
     // add informations
     $this->prepare_informations();
     // @todo load scripts
     if (function_exists('wpcf_edit_post_screen_scripts')) {
         wpcf_edit_post_screen_scripts();
     }
 }
 /**
  * @param $post_types
  * @param $headline
  *
  * @return string
  */
 private function get_dashboard_types_table($post_types, $headline, $post_type_edit_link = true)
 {
     // documentation urls
     $documentation_urls = (include TYPES_DATA . '/documentation-urls.php');
     // add links to use analytics
     Types_Helper_Url::add_urls($documentation_urls);
     // set analytics medium
     Types_Helper_Url::set_medium('dashboard');
     /* messages */
     $messages_files = array(TYPES_DATA . '/dashboard/table/template.php', TYPES_DATA . '/dashboard/table/archive.php', TYPES_DATA . '/dashboard/table/views.php', TYPES_DATA . '/dashboard/table/forms.php');
     // add dashboard
     $rows = '';
     foreach ($post_types as $post_type) {
         $info_post_type = new Types_Information_Table('types-information-table');
         Types_Helper_Condition::set_post_type($post_type->get_name());
         Types_Helper_Placeholder::set_post_type($post_type->get_name());
         foreach ($messages_files as $message_file) {
             $this->load_data_to_table($message_file, $info_post_type);
         }
         $row = $this->get_twig()->render('/page/dashboard/table/tbody-row.twig', array('labels' => array('or' => __('Or...', 'types'), 'create_taxonomy' => __('Create taxonomy', 'types'), 'create_field_group' => __('Create field group', 'types'), 'no_archive_for' => __('No archive available for %s', 'types')), 'admin_url' => admin_url(), 'post_type' => $post_type, 'table' => $info_post_type, 'post_type_edit_link' => $post_type_edit_link));
         Types_Helper_Placeholder::replace($row);
         $rows .= $row;
     }
     // table view
     $data_thead = (require TYPES_DATA . '/dashboard/table/head.php');
     $table = $this->get_twig()->render('/page/dashboard/table.twig', array('labels' => array('headline' => $headline, 'admin' => __('WordPress admin', 'types'), 'frontend' => __('Front-end', 'types'), 'or' => __('Or...', 'types')), 'admin_url' => admin_url(), 'thead' => $data_thead, 'rows' => $rows));
     return $table;
 }
Example #6
0
/**
 * Returns contextual help.
 *
 * @param string $page
 * @param $contextual_help
 *
 * @return string
 * @deprecated Use Types_Asset_Help_Tab_Loader instead.
 */
function wpcf_admin_help($page, $contextual_help = '')
{
    Types_Helper_Url::load_documentation_urls();
    Types_Helper_Url::set_medium(Types_Helper_Url::UTM_MEDIUM_HELP);
    $help = '';
    switch ($page) {
        // Post Fields (list)
        case 'custom_fields':
        case 'wpcf-cf':
            $help .= '' . __("Types plugin organizes post fields in groups. Once you create a group, you can add the fields to it and control to what content it belongs.", 'wpcf') . PHP_EOL . PHP_EOL . sprintf(__('You can read more about Post Fields in this tutorial: %s.', 'wpcf'), sprintf('<a href="%s" target="_blank">%s &raquo;</a>', Types_Helper_Url::get_url('using-post-fields', true, 'using-custom-fields'), Types_Helper_Url::get_url('using-post-fields', false, false, false, false))) . PHP_EOL . PHP_EOL . __("On this page you can see your current post field groups, as well as information about which post types and taxonomies they are attached to, and whether they are active or not.", 'wpcf') . PHP_EOL . PHP_EOL . sprintf('<h3>%s</h3>', __('You have the following options:', 'wpcf')) . '<dl>' . '<dt>' . __('Add New', 'wpcf') . '</dt>' . '<dd>' . __('Use this to add a new post fields group which can be attached to a post type', 'wpcf') . '</dd>' . '<dt>' . __('Edit', 'wpcf') . '</dt>' . '<dd>' . __('Click to edit the post field group', 'wpcf') . '</dd>' . '<dt>' . __('Activate', 'wpcf') . '</dt>' . '<dd>' . __('Click to activate a post field group', 'wpcf') . '</dd>' . '<dt>' . __('Deactivate', 'wpcf') . '</dt>' . '<dd>' . __('Click to deactivate a post field group (this can be re-activated at a later date)', 'wpcf') . '</dd>' . '<dt>' . __('Delete', 'wpcf') . '</dt>' . '<dd>' . __('Click to delete a post field group.', 'wpcf') . ' ' . sprintf('<strong>%s</strong>', __('Warning: This cannot be undone.', 'wpcf')) . '</dd>' . '</dl>';
            break;
        case 'need-more-help':
            // Post fields
            $help .= sprintf('<h4>%s</h4>', __('Post Fields', 'wpcf'));
            $help .= '<ul>';
            $help .= sprintf('<li><a target="_blank" href="%s">%s &raquo;</a></li>', Types_Helper_Url::get_url('adding-fields', true), __('Adding post fields to content', 'wpcf'));
            $help .= sprintf('<li><a target="_blank" href="%s">%s &raquo;</a></li>', Types_Helper_Url::get_url('displaying-fields', true), __('Displaying post fields on front-end', 'wpcf'));
            $help .= '</ul>';
            // User fields
            $help .= sprintf('<h4>%s</h4>', __('User Fields', 'wpcf'));
            $help .= '<ul>';
            $help .= sprintf('<li><a target="_blank" href="%s">%s &raquo;</a></li>', Types_Helper_Url::get_url('adding-user-fields', true), __('Adding user fields to user profiles', 'wpcf'));
            $help .= sprintf('<li><a target="_blank" href="%s">%s &raquo;</a></li>', Types_Helper_Url::get_url('displaying-user-fields', true), __('Displaying user fields on front-end', 'wpcf'));
            $help .= '</ul>';
            // Term fields
            $help .= sprintf('<h4>%s</h4>
				<ul>
					<li><a target="_blank" href="%s">%s &raquo;</a></li>
					<li><a target="_blank" href="%s">%s &raquo;</a></li>
				</ul>', __('Term Fields', 'wpcf'), Types_Helper_Url::get_url('adding-term-fields', true), __('Adding term fields to taxonomies', 'wpcf'), Types_Helper_Url::get_url('displaying-term-fields', true), __('Displaying term fields on front-end', 'wpcf'));
            $help .= sprintf('<h4>%s</h4>', __('Post Types and Taxonomy', 'wpcf'));
            $help .= '<ul>';
            $help .= sprintf('<li><a target="_blank" href="%s">%s &raquo;</a></li>', Types_Helper_Url::get_url('custom-post-types', true), __('Creating and using post types', 'wpcf'));
            $help .= sprintf('<li><a target="_blank" href="%s">%s &raquo;</a></li>', Types_Helper_Url::get_url('custom-taxonomy', true), __('Arranging content with Taxonomy', 'wpcf'));
            $help .= sprintf('<li><a target="_blank" href="%s">%s &raquo;</a></li>', Types_Helper_Url::get_url('post-relationship', true), __('Creating parent / child relationships', 'wpcf'));
            $help .= '</ul>';
            break;
        case 'wpcf-ctt':
        case 'custom_taxonomies_list':
            $help .= '' . __('This is the Taxonomies list. It provides you with an overview of your data.', 'wpcf') . PHP_EOL . PHP_EOL . sprintf(__('You can read more about Post Types and Taxonomies in this tutorial. %s', 'wpcf'), sprintf('<a href="%s" target="_blank">%s &raquo;</a>', Types_Helper_Url::get_url('custom-post-types', true), Types_Helper_Url::get_url('custom-post-types', false, false, false, false))) . PHP_EOL . PHP_EOL . sprintf('<h3>%s</h3>', __('On this page you have the following options:', 'wpcf')) . '<dl>' . '<dt>' . __('Add New', 'wpcf') . '<dd>' . __('Use to create a new Taxonomy', 'wpcf') . '<dt>' . __('Edit', 'wpcf') . '<dd>' . __('Click to edit the settings of a Taxonomy', 'wpcf') . '</dd>' . '<dt>' . __('Deactivate', 'wpcf') . '<dd>' . __('Click to deactivate a Taxonomy (this can be reactivated at a later date)', 'wpcf') . '</dd>' . '<dt>' . __('Duplicate', 'wpcf') . '<dd>' . __('Click to duplicate a Taxonomy', 'wpcf') . '</dd>' . '<dt>' . __('Delete', 'wpcf') . '<dd>' . __('Click to delete a Taxonomy.', 'wpcf') . ' ' . sprintf('<strong>%s</strong>', __('Warning: This cannot be undone.', 'wpcf')) . '</dd>' . '</dl>';
            break;
        case 'wpcf-cpt':
        case 'post_types_list':
            $help .= '' . __('This is the main admin page for built-in Post Types and your Post Types. It provides you with an overview of your data.', 'wpcf') . PHP_EOL . PHP_EOL . __('Post Types are built-in and user-defined content types.', 'wpcf') . PHP_EOL . PHP_EOL . sprintf(__('You can read more about Post Types and Taxonomies in this tutorial. %s', 'wpcf'), sprintf('<a href="%s" target="_blank">%s &raquo;</a>', Types_Helper_Url::get_url('custom-post-types', true), Types_Helper_Url::get_url('custom-post-types', false, false, false, false))) . PHP_EOL . PHP_EOL . sprintf('<h3>%s</h3>', __('On this page you have the following options:', 'wpcf')) . '<dl>' . '<dt>' . __('Add New', 'wpcf') . '</dt>' . '<dd>' . __('Use to create a new Post Type', 'wpcf') . '</dd>' . '<dt>' . __('Edit', 'wpcf') . '</dt>' . '<dd>' . __('Click to edit the settings of a Post Type', 'wpcf') . '</dd>' . '<dt>' . __('Deactivate', 'wpcf') . '</dt>' . '<dd>' . __('Click to deactivate a Post Type (this can be reactivated at a later date)', 'wpcf') . '</dd>' . '<dt>' . __('Duplicate', 'wpcf') . '<dd>' . __('Click to duplicate a Post Type', 'wpcf') . '</dd>' . '<dt>' . __('Delete', 'wpcf') . '</dt>' . '<dd>' . __('Click to delete a Post Type.', 'wpcf') . ' ' . sprintf('<strong>%s</strong>', __('Warning: This cannot be undone.', 'wpcf')) . '</dd>' . '</dl>';
            break;
            // Add/Edit group form page
        // Add/Edit group form page
        case 'wpcf-edit':
        case 'edit_group':
            $help .= '' . __('This is the edit page for your Post Field Groups.', 'wpcf') . PHP_EOL . PHP_EOL . __('On this page you can create and edit your groups. To create a group, do the following:', 'wpcf') . '<ol style="list-style-type:decimal;"><li style="list-style-type:decimal;">' . __('Add a Title.', 'wpcf') . '</li><li style="list-style-type:decimal;">' . __('Choose where to display your group. You can attach this to both default WordPress post types and Post Types (you can also associate Taxonomy terms with Post Field Groups).', 'wpcf') . '</li><li style="list-style-type:decimal;">' . __('To add a field, click on "Add New Field" and choose the field you desire. This will be added to your Post Field Group.', 'wpcf') . '</li><li style="list-style-type:decimal;">' . __('Add information about your Post Field.', 'wpcf') . '</li></ol>' . '<h3>' . __('Tips', 'wpcf') . '</h3>' . '<ul><li>' . __('To ensure a user fills out a field, check Required in Validation section.', 'wpcf') . '</li><li>' . __('Once you have created a field, it will be saved for future use under "Choose from previously created fields" of "Add New Field" dialog.', 'wpcf') . '</li><li>' . __('You can drag and drop the order of your post fields.', 'wpcf') . '</li></ul>';
            break;
            // Add/Edit custom type form page
        // Add/Edit custom type form page
        case 'wpcf-edit-type':
        case 'edit_type':
            $help .= '' . __('Use this page to create a WordPress post type. If you’d like to learn more about Post Types you can read our detailed guide: <a href="https://wp-types.com/user-guides/create-a-custom-post-type/" target="_blank">https://wp-types.com/user-guides/create-a-custom-post-type/</a>', 'wpcf') . PHP_EOL . PHP_EOL . '<dt>' . __('Name and Description', 'wpcf') . '</dt>' . '<dd>' . __('Add a singular and plural name for your post type. You should also add a slug. This will be created from the post type name if none is added.', 'wpcf') . '</dd>' . '<dt>' . __('Visibility', 'wpcf') . '</dt>' . '<dd>' . __('Determine whether your post type will be visible on the admin menu to your users.', 'wpcf') . '</dd>' . '<dd>' . __('You can also adjust the menu position. The default position is 20, which means your post type will appear under “Pages”. You can find more information about menu positioning in the WordPress Codex. <a href="http://codex.wordpress.org/Function_Reference/register_post_type#Parameters" target="_blank">http://codex.wordpress.org/Function_Reference/register_post_type#Parameters</a>', 'wpcf') . '</dd>' . '<dd>' . __('The default post type icon is the pushpin icon that appears beside WordPress posts. You can change this by adding your own icon of 16px x 16px.', 'wpcf') . '</dd>' . '<dt>' . __('Select Taxonomies', 'wpcf') . '</dt>' . '<dd>' . __('Choose which taxonomies are to be associated with this post type.', 'wpcf') . '</dd>' . '<dt>' . __('Labels', 'wpcf') . '</dt>' . '<dd>' . __('Labels are the text that is attached to your post type name. Examples of them in use are “Add New Post” (where “Add New” is the label”) and “Edit Post” (where “Edit” is the label). In normal circumstances the defaults will suffice.', 'wpcf') . '</dd>' . '<dt>' . __('Custom Post Properties', 'wpcf') . '</dt>' . '<dd>' . __('Choose which sections to display on your “Add New” page.', 'wpcf') . '</dd>' . '<dt>' . __('Advanced Settings', 'wpcf') . '</dt>' . '<dd>' . __('Advanced settings give you even more control over your post type. You can read in detail what all of these settings do on our tutorial.', 'wpcf') . '</dd>' . '</dl>';
            break;
            // Add/Edit Taxonomy form page
        // Add/Edit Taxonomy form page
        case 'wpcf-edit-tax':
        case 'edit_tax':
            $help .= '' . __('You can use Taxonomies to categorize your content. Read more about what they are on our website: <a href="https://wp-types.com/user-guides/create-a-custom-post-type/" target="_blank">https://wp-types.com/user-guides/create-a-custom-post-type/ &raquo;</a> or you can read our guide about how to set them up: <a href="http://wp-types.com/user-guides/create-custom-taxonomies/" target="_blank">http://wp-types.com/user-guides/create-custom-taxonomies/</a>', 'wpcf') . '<dl>' . '<dt>' . __('Name and Description', 'wpcf') . '</dt>' . '<dd>' . __('Add a singular and plural name for your Taxonomy. You should also add a slug. This will be created from the Taxonomy name if none is added.', 'wpcf') . '</dd>' . '<dt>' . __('Visibility', 'wpcf') . '</dt>' . '<dd>' . __('Determine whether your Taxonomy will be visible on the admin menu to your users.', 'wpcf') . '</dd>' . '<dt>' . __('Select Post Types', 'wpcf') . '</dt>' . '<dd>' . __('Choose which Post Types this Taxonomy should be associated with.', 'wpcf') . '</dd>' . '<dt>' . __('Labels', 'wpcf') . '</dt>' . '<dd>' . __('Labels are the text that is attached to your Taxonomy name. Examples of them in use are “Add New Taxonomy” (where “Add New” is the label”) and “Edit Taxonomy” (where “Edit” is the label). In normal circumstances the defaults will suffice.', 'wpcf') . '</dd>' . '<dt>' . __('Options', 'wpcf') . '</dt>' . '<dd>' . __('Advanced settings give you even more control over your Taxonomy. You can read in detail what all of these settings do on our tutorial.', 'wpcf') . '</dd>' . '</dl>';
            break;
        case 'wpcf-um':
        case 'user_fields_list':
            $help .= '' . __("Types plugin organizes User Fields in groups. Once you create a group, you can add the fields to it and control to what content it belongs.", 'wpcf') . PHP_EOL . PHP_EOL . __("On this page you can see your current User Fields groups, as well as information about which user role they are attached to, and whether they are active or not.", 'wpcf') . sprintf('<h3>%s</h3>', __('You have the following options:', 'wpcf')) . '<dl>' . '<dt>' . __('Add New', 'wpcf') . '</dt>' . '<dd>' . __('Use this to add a new User Field Group', 'wpcf') . '</dd>' . '<dt>' . __('Edit', 'wpcf') . '</dt>' . '<dd>' . __('Click to edit the User Field Group', 'wpcf') . '</dd>' . '<dt>' . __('Activate', 'wpcf') . '</dt>' . '<dd>' . __('Click to activate a User Field Group', 'wpcf') . '</dd>' . '<dt>' . __('Deactivate', 'wpcf') . '</dt>' . '<dd>' . __('Click to deactivate a User Field Group (this can be re-activated at a later date)', 'wpcf') . '</dd>' . '<dt>' . __('Delete', 'wpcf') . '</dt>' . '<dd>' . __('Click to delete a User Field Group.', 'wpcf') . ' ' . sprintf('<strong>%s</strong>', __('Warning: This cannot be undone.', 'wpcf')) . '</dd>' . '</dl>';
            break;
        case 'wpcf-edit-usermeta':
        case 'user_fields_edit':
            $help .= '' . __('This is the edit page for your User Field Groups.', 'wpcf') . PHP_EOL . PHP_EOL . __('On this page you can create and edit your groups. To create a group, do the following:', 'wpcf') . '<ol><li>' . __('Add a Title', 'wpcf') . '</li><li>' . __('Choose where to display your group. You can attach this to both default WordPress user roles and custom roles.', 'wpcf') . '</li><li>' . __('To add a field, click on "Add New Field" and choose the field you desire. This will be added to your User Field Group.', 'wpcf') . '</li><li>' . __('Add information about your User Field.', 'wpcf') . '</li></ol>' . '<h3>' . __('Tips', 'wpcf') . '</h3>' . '<ul><li>' . __('To ensure a user fills out a field, check Required in Validation section.', 'wpcf') . '</li><li>' . __('Once you have created a field, it will be saved for future use under "Choose from previously created fields" of "Add New Field" dialog.', 'wpcf') . '</li><li>' . __('You can drag and drop the order of your user fields.', 'wpcf') . '</li></ul>';
            break;
    }
    // to keep already translated strings
    $help = str_replace('href="https://wp-types.com/user-guides/create-a-custom-post-type/"', 'href="' . Types_Helper_Url::get_url('custom-post-types', true) . '"', $help);
    $help = str_replace('href="http://wp-types.com/user-guides/create-a-custom-post-type/"', 'href="' . Types_Helper_Url::get_url('custom-post-types', true) . '"', $help);
    $help = str_replace('href="http://wp-types.com/user-guides/create-custom-taxonomies/"', 'href="' . Types_Helper_Url::get_url('custom-taxonomy', true) . '"', $help);
    $help = str_replace('href="http://wp-types.com/user-guides/using-custom-fields/"', 'href="' . Types_Helper_Url::get_url('using-post-fields', true, 'post-fields') . '"', $help);
    return wpautop($help);
}
            break;
        case 'wpcf-edit-tax':
            $medium = 'taxonomy-edit';
            break;
        case 'wpcf-edit':
            $medium = 'custom-fields-group-edit';
            break;
        case 'wpcf-edit-usermeta':
            $medium = 'user-fields-group-edit';
            break;
        default:
            $medium = 'types';
    }
}
Types_Helper_Url::load_documentation_urls();
Types_Helper_Url::set_medium($medium);
return array('title' => __('Displaying Custom Content', 'wpcf'), 'content' => '
		<div class="wpcf-howto-views wpcf-info-box-with-icon">
            <div class="wpcf-icon">
                <span class="icon-types-logo"></span>
            </div>
            <div class="wpcf-info">
                <p>
                    ' . __('The complete Toolset package lets you display custom content on the site’s front-end easily, without writing PHP code.', 'wpcf') . '
                </p>

                 <a target="_blank" href="' . Types_Helper_Url::get_url('compare-toolset-php', true) . '"><b>' . __('Toolset vs. PHP comparison', 'wpcf') . '</b></a>
            </div>


            <p style="padding-top: 10px; margin-bottom: 0; border-top: 1px solid #eee;">
Example #8
0
    <a href="javascript:void(0);" class="wpcf-button show <?php 
        if ($update) {
            echo 'wpcf-show';
        } else {
            echo 'wpcf-hide';
        }
        ?>
"><?php 
        _e('Show next steps and documentation', 'wpcf');
        ?>
<span class="wpcf-button-arrow show"></span></a>
<?php 
    }
    $class = $update ? ' wpcf-hide' : ' wpcf-show';
    Types_Helper_Url::load_documentation_urls();
    Types_Helper_Url::set_medium('next-steps');
    ?>
    <div class="wpcf-notif-dropdown<?php 
    echo $class;
    ?>
">
        <span><strong><?php 
    _e('Next, learn how to:', 'wpcf');
    ?>
</strong></span>
        <?php 
    if ($type == 'post_type') {
        ?>
            <ul>
                <li>
	                <?php