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 $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; }
/** * Load URLs to documentation links so they can be obtained via get_url(). * * @since 2.1 */ public static function load_documentation_urls() { if (!self::$documentation_urls_loaded) { $documentation_urls = (include TYPES_DATA . '/documentation-urls.php'); Types_Helper_Url::add_urls($documentation_urls); self::$documentation_urls_loaded = true; } }
function types_getting_started_init() { $version = get_option('WPCF_VERSION'); // just show for new activate types (so not for old users just updating types) if (version_compare($version, '2.2', '<')) { return; } // abort if user dismissed message $user_dismissed_notices = get_user_meta(get_current_user_id(), '_types_notice_dismiss_permanent', true); if (is_array($user_dismissed_notices) && in_array('getting-started', $user_dismissed_notices)) { return; } add_action('admin_notices', 'types_getting_started'); add_action('admin_enqueue_scripts', 'types_getting_started_scripts'); // documentation urls $documentation_urls = (include TYPES_DATA . '/documentation-urls.php'); // add links to use analytics Types_Helper_Url::add_urls($documentation_urls); function types_getting_started() { ?> <div class="notice is-dismissible" data-types-notice-dismiss-permanent="getting-started" style="border-left-color: #f05a29; position: relative; padding-right: 38px;"> <div class="types-message-icon" style="float: left; margin: 2px 0 0 0; padding: 0 15px 0 0;"> <?php //<span class="icon-toolset-logo"></span> ?> <span class="icon-types-logo ont-icon-64" style="color: #f05a29;""></span> </div> <div style="margin-top: 8px;"> <p> <?php _e('Toolset Types lets you add custom post types, custom fields and taxonomy.', 'wpcf'); ?> </p> <a class="button-primary types-button types-external-link" style="margin-right: 10px;" target="_blank" href="<?php echo Types_Helper_Url::get_url('getting-started-types', 'notice-dismissible'); ?> "> <?php _e('Getting started guide', 'wpcf'); ?> </a> <span class="notice-dismiss"><span class="screen-reader-text">Dismiss</span></span> </div> <br style="clear:both;" /> </div> <?php } function types_getting_started_scripts() { wp_enqueue_script('types-notice-dismiss', TYPES_RELPATH . '/public/js/notice-dismiss.js', array('jquery'), TYPES_VERSION, true); wp_enqueue_style('types-information', TYPES_RELPATH . '/public/css/information.css', array('wp-jquery-ui-dialog'), TYPES_VERSION); } }