function testSiteURL()
 {
     $site = new TimberSite();
     $this->assertEquals('http://example.org', $site->get_url());
     $this->assertEquals('http://example.org', $site->url());
     $this->assertEquals('http://example.org', $site->link());
 }
示例#2
0
 function __construct()
 {
     $this->set_theme_support();
     $this->set_theme_filter();
     $this->set_theme_action();
     parent::__construct();
 }
示例#3
0
 function __construct()
 {
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_theme_support('title-tag');
     add_filter('timber_context', array($this, 'add_user_nav_info_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_filter('xv_planeta_feed', '__return_true');
     add_filter('wpseo_twitter_creator_account', function ($twitter) {
         return '@softcatala';
     });
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'sc_rewrite_search'));
     add_action('template_redirect', array($this, 'sc_change_programs_search_url_rewrite'));
     add_action('init', array($this, 'sc_author_rewrite_base'));
     add_action('template_redirect', array($this, 'fix_woosidebar_hooks'), 1);
     add_action('template_redirect', array($this, 'sc_change_search_url_rewrite'));
     add_action('after_setup_theme', array($this, 'include_theme_conf'));
     //SC Dashboard settings
     add_action('admin_menu', array($this, 'include_sc_settings'));
     spl_autoload_register(array($this, 'autoload'));
     add_post_type_support('programa', 'woosidebars');
     parent::__construct();
 }
示例#4
0
 function __construct()
 {
     // add_theme_support( 'post-formats' );
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_menus'));
     parent::__construct();
 }
示例#5
0
 function __construct()
 {
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_taxonomies'));
     parent::__construct();
 }
示例#6
0
文件: avst.php 项目: nerdhaus/avse
 function __construct()
 {
     add_theme_support('html5', array('comment-list', 'comment-form', 'search-form', 'gallery', 'caption'));
     add_theme_support('post-formats', array('standard', 'link', 'image', 'audio', 'chat'));
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_taxonomies'));
     parent::__construct();
 }
示例#7
0
 function __construct()
 {
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_taxonomies'));
     remove_action('ninja_forms_display_css', 'ninja_forms_display_css', 10, 2);
     parent::__construct();
 }
示例#8
0
 function __construct()
 {
     add_theme_support("post-formats");
     add_theme_support("post-thumbnails");
     add_theme_support("menus");
     add_action("init", array($this, "register_post_types"));
     add_action("init", array($this, "register_taxonomies"));
     add_action("wp_enqueue_scripts", array($this, "enqueue_scripts"));
     add_filter("timber_context", array($this, "add_to_context"));
     add_filter("get_twig", array($this, "add_to_twig"));
     parent::__construct();
 }
 function __construct()
 {
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', [$this, 'add_to_context']);
     add_filter('get_twig', [$this, 'add_to_twig']);
     add_action('init', [$this, 'register_post_types']);
     add_action('init', [$this, 'register_taxonomies']);
     // add_image_size('my_iamge_size', 1200, 9999);
     parent::__construct();
 }
示例#10
0
 function __construct()
 {
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     // add_action('pre_get_posts', 'wpa84258_admin_posts_sort_last_name');
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_taxonomies'));
     add_filter('embed_oembed_html', 'my_embed_oembed_html', 99, 4);
     parent::__construct();
 }
示例#11
0
 function __construct()
 {
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', [$this, 'addToContext']);
     add_filter('get_twig', [$this, 'addToTwig']);
     add_filter('body_class', [$this, 'addPageClass']);
     add_action('init', [$this, 'registerPostTypes']);
     add_action('init', [$this, 'registerTaxonomies']);
     add_action('wp_enqueue_scripts', [$this, 'themeAssets']);
     parent::__construct();
 }
 /**
  * Setup the site
  */
 function __construct()
 {
     add_theme_support('post-formats', array('link'));
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_action('after_setup_theme', array($this, 'addImagesSizes'));
     add_filter('timber_context', array($this, 'addToContext'));
     add_filter('get_twig', array($this, 'addToTwig'));
     add_action('init', array($this, 'custom_rewrite_basic'));
     add_filter('query_vars', array($this, 'api_query_vars'));
     $this->deactivateSearch();
     parent::__construct();
 }
示例#13
0
 function __construct()
 {
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_taxonomies'));
     add_action('wp_enqueue_scripts', array($this, 'load_styles'));
     add_action('wp_footer', array($this, 'load_scripts'));
     parent::__construct();
 }
 function __construct()
 {
     remove_action('wp_head', 'print_emoji_detection_script', 7);
     remove_action('wp_print_styles', 'print_emoji_styles');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_filter('custom_menu_order', array($this, 'custom_menu_order'));
     add_filter('menu_order', array($this, 'custom_menu_order'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_custom_fields'));
     add_action('after_setup_theme', array($this, 'remove_wordpress_meta_from_head'));
     add_action('do_meta_boxes', array($this, 'remove_unused_meta_box'));
     add_action('admin_menu', array($this, 'remove_unused_cms_menus'));
     add_action('admin_menu', array($this, 'wphidenag'));
     add_action('admin_init', array($this, 'edit_post_columns'));
     add_action('after_setup_theme', array($this, 'remove_post_formats'), 11);
     add_action('acf/save_post', array($this, 'prevent_acf_options_tickbox_from_saving'), 1);
     add_filter('acf/update_value/key=basic_hero_images', array($this, 'hero_images_set_featured_image'), 10, 3);
     add_filter('robots_txt', array($this, 'force_robots_txt_disallow_non_production'), 10, 2);
     add_filter('upload_mimes', array($this, 'allowAdditionalUploadMimeTypes'));
     add_filter('tiny_mce_before_init', array($this, 'mce_mod'));
     add_filter('mce_buttons', array($this, 'my_mce_buttons'));
     add_filter('acf/render_field/type=flexible_content', array($this, 'add_collapse_all'), 9, 1);
     add_filter('acf/update_value/key=article_related_lists', array($this, 'add_default_list'), 11, 3);
     // Recrop images clear out Timber resize() images
     include_once __DIR__ . '/libs/services/ImageService.php';
     add_action('yoimg_post_crop_image', array('AgreableImageService', 'delete_timber_resized_images'), 1, 1);
     add_filter('admin_footer_text', array($this, 'change_admin_footer_text'));
     // Set JPEG quality to 80
     add_filter('jpeg_quality', function () {
         return 80;
     });
     // Force WP to crop images to largest possible size based on thumbnail settings.
     // Previously attempt at cropping would be abandoned if source was too small.
     add_filter('image_resize_dimensions', array($this, 'image_crop_dimensions'), 10, 6);
     // Prevent empty ACF text fields returning an ugly array instead of null
     add_filter('timber_post_get_meta', array($this, 'post_meta_custom_map'), 10, 2);
     // Set posts inthe post preview plugin to never expire
     add_filter('ppp_nonce_life', array($this, 'custom_post_preview_lifespan'));
     // If original-url is passed, override the canonical UR
     // Allows embedding e.g. Via Catfish CMS Full Page Embed
     if (isset($_GET['original-url']) && getenv('CANONICAL_DOMAIN')) {
         remove_action('wp_head', 'rel_canonical');
         add_action('wp_head', array($this, 'canonical_url_override'));
     }
     parent::__construct();
     do_action('agreable_base_theme_init');
     $this->category_setup();
 }
示例#15
0
 function __construct()
 {
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_taxonomies'));
     add_action('widgets_init', array($this, 'register_sidebars'));
     add_shortcode('tag', array($this, 'shortcode_tag_link'));
     add_filter('use_default_gallery_style', '__return_false');
     add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
     parent::__construct();
 }
示例#16
0
 public function __construct()
 {
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_taxonomies'));
     // load filenames from manifest file
     // used to determinate asset real path
     if (!defined('CHISEL_DEV_ENV') && file_exists(get_template_directory() . '/' . $this->manifestPath)) {
         $this->manifest = json_decode(file_get_contents(get_template_directory() . '/' . $this->manifestPath), true);
     }
     add_filter('Timber\\PostClassMap', array($this, 'override_timber_post_class'));
     parent::__construct();
 }
示例#17
0
 function __construct()
 {
     remove_action('wp_head', 'wp_generator');
     remove_action('wp_head', 'wlwmanifest_link');
     remove_action('wp_head', 'rsd_link');
     remove_action('wp_head', 'feed_links', 2);
     remove_action('wp_head', 'feed_links_extra', 3);
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_taxonomies'));
     add_action('init', array($this, 'load_footer_scripts'));
     add_action('wp_enqueue_scripts', array($this, 'load_styles'));
     parent::__construct();
 }
 function __construct()
 {
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_taxonomies'));
     add_action('init', array($this, 'register_menus'));
     add_shortcode('tease_post', array($this, 'tease_post_func'));
     add_action('wp_enqueue_scripts', array($this, 'scripts'));
     add_action('widgets_init', array($this, 'widget_locations_init'));
     add_action('widgets_init', function () {
         register_widget('NavbarSearchWidget');
     });
     parent::__construct();
 }
 function __construct()
 {
     load_theme_textdomain('nilslindstrom-theme', get_template_directory() . '/languages');
     add_theme_support('automatic-feed-links');
     add_theme_support('title-tag');
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
     add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link'));
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     register_nav_menus(array('primary' => esc_html__('Primary', 'theme'), 'footer' => esc_html__('Footer', 'theme')));
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_taxonomies'));
     add_action('init', array($this, 'rewrite_rules'));
     add_action('wp_enqueue_scripts', array($this, 'loadScripts'));
     add_action('widgets_init', array($this, 'widgets'));
     parent::__construct();
 }
示例#20
0
 /**
  *__construct
  *
  * @param string|int $site_name_or_id
  */
 function __construct($site_name_or_id = null)
 {
     $this->stylesheet = get_theme_mod('stylesheet', 'styles.css');
     // add custom params
     $this->keywords = apply_filters('site_keywords', implode(', ', array_map(function ($tag) {
         return $tag->name;
     }, get_tags(array('orderby' => 'count', 'order' => 'DESC', 'number' => 20)))));
     $this->logo = apply_filters('site_logo', get_theme_mod('logo'));
     $this->copyright = apply_filters('site_copyright', get_theme_mod('copyright'));
     // replace the site icon with an image object
     if ($this->site_icon) {
         $this->site_icon = new \TimberImage($this->site_icon);
     }
     // google webmaster site verification code
     $this->google_site_verification = get_theme_mod('google_verification_code');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_filter('meta_description', array('PressGang\\Site', 'meta_description'));
     parent::__construct($site_name_or_id);
 }
示例#21
0
 function __construct()
 {
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_theme_support('title-tag');
     // Register Menus
     register_nav_menus(array('primary' => esc_html__('Primary', 'sustainable-interiors'), 'resources' => esc_html__('Footer Resources', 'sustainable-interiors')));
     // Register Image Sizes
     // Home Image Sizes
     add_image_size('home-hero', 1300, 668, true);
     add_image_size('post-block', 650, 308, true);
     // Interior Template Image Sizes
     add_image_size('interior-hero', 1300, 280, true);
     add_image_size('interior-showcase', 930, 435, true);
     add_image_size('interior-team', 275, 275, true);
     add_image_size('interior-grid', 575, 275, true);
     add_image_size('interior-product', 490, 505, true);
     add_image_size('interior-portfolio-slider', 975, 500, true);
     add_image_size('interior-portfolio-carousel', 180, 105, true);
     //RTE Image Sizes
     add_image_size('small', 230, 230, true);
     update_option('medium_size_w', 445);
     update_option('medium_size_h', 445);
     update_option('large_size_w', 965);
     update_option('large_size_h', 965);
     // General Site Setup
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_action('init', array($this, 'register_portfolio_post_type'));
     add_action('init', array($this, 'register_product_post_type'));
     add_action('init', array($this, 'register_team_post_type'));
     add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
     // AJAX Handlers
     // Portfolio Popup
     add_action('wp_ajax_nopriv_portfolio_popup', array($this, 'render_portfolio_popup'));
     add_action('wp_ajax_portfolio_popup', array($this, 'render_portfolio_popup'));
     // Product Popup
     add_action('wp_ajax_nopriv_product_popup', array($this, 'render_product_popup'));
     add_action('wp_ajax_product_popup', array($this, 'render_product_popup'));
     parent::__construct();
 }
示例#22
0
 public function __construct()
 {
     $this->add_default_views_location();
     $this->_add_theme_support();
     $this->_add_editor_style();
     $this->_add_nav_menus();
     $this->_add_sidebars();
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_taxonomies'));
     // Styles
     add_action('init', array($this, 'register_styles'));
     if (!is_admin()) {
         add_action('wp_enqueue_scripts', array($this, 'enqueue_styles'));
     }
     // Scripts
     add_action('init', array($this, 'register_scripts'));
     if (!is_admin()) {
         add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
     }
     add_filter('body_class', array($this, 'add_body_classes'));
     parent::__construct();
 }
示例#23
0
 function testSiteMeta()
 {
     $ts = new TimberSite();
     update_option('foo', 'magoo');
     $this->assertEquals('magoo', $ts->meta('foo'));
 }
示例#24
0
 function __construct()
 {
     add_filter('timber_context', array($this, 'add_to_context'));
     parent::__construct();
 }
示例#25
0
 function __construct()
 {
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', [$this, 'addToTwig']);
     parent::__construct();
 }