當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TimberHelper::get_rel_url方法代碼示例

本文整理匯總了PHP中TimberHelper::get_rel_url方法的典型用法代碼示例。如果您正苦於以下問題:PHP TimberHelper::get_rel_url方法的具體用法?PHP TimberHelper::get_rel_url怎麽用?PHP TimberHelper::get_rel_url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TimberHelper的用法示例。


在下文中一共展示了TimberHelper::get_rel_url方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_path

 public function get_path()
 {
     return TimberHelper::get_rel_url($this->get_link());
 }
開發者ID:pedrokoblitz,項目名稱:centro-dialogo-aberto,代碼行數:4,代碼來源:timber-post.php

示例2: get_path

 public function get_path()
 {
     $link = $this->get_link();
     $rel = TimberHelper::get_rel_url($link, true);
     return apply_filters('timber_term_path', $rel, $this);
 }
開發者ID:pedrokoblitz,項目名稱:centro-dialogo-aberto,代碼行數:6,代碼來源:timber-term.php

示例3: init_with_url

 function init_with_url($url)
 {
     $this->abs_url = $url;
     $this->file_loc = $url;
     if (TimberHelper::is_local($url)) {
         $this->file = ABSPATH . TimberHelper::get_rel_url($url);
     }
 }
開發者ID:pedrokoblitz,項目名稱:centro-dialogo-aberto,代碼行數:8,代碼來源:timber-image.php

示例4: add_twig_filters

 /**
  * @param Twig_Environment $twig
  * @return Twig_Environment
  */
 function add_twig_filters($twig)
 {
     /* image filters */
     $twig->addFilter('resize', new Twig_Filter_Function(array('TimberImageHelper', 'resize')));
     $twig->addFilter('letterbox', new Twig_Filter_Function('wp_resize_letterbox'));
     $twig->addFilter('tojpg', new Twig_Filter_Function(array('TimberImageHelper', 'img_to_jpg')));
     $twig->addFilter('get_src_from_attachment_id', new Twig_Filter_Function('twig_get_src_from_attachment_id'));
     /* debugging filters */
     $twig->addFilter('docs', new Twig_Filter_function('twig_object_docs'));
     $twig->addFilter('get_class', new Twig_Filter_Function('twig_get_class'));
     $twig->addFilter('get_type', new Twig_Filter_Function('twig_get_type'));
     $twig->addFilter('print_r', new Twig_Filter_Function('twig_print_r'));
     $twig->addFilter('print_a', new Twig_Filter_Function('twig_print_a'));
     /* other filters */
     $twig->addFilter('stripshortcodes', new Twig_Filter_Function('strip_shortcodes'));
     $twig->addFilter('array', new Twig_Filter_Function(array($this, 'to_array')));
     $twig->addFilter('excerpt', new Twig_Filter_Function('twig_make_excerpt'));
     $twig->addFilter('function', new Twig_Filter_Function(array($this, 'exec_function')));
     $twig->addFilter('path', new Twig_Filter_Function('twig_get_path'));
     $twig->addFilter('pretags', new Twig_Filter_Function(array($this, 'twig_pretags')));
     $twig->addFilter('sanitize', new Twig_Filter_Function('sanitize_title'));
     $twig->addFilter('shortcodes', new Twig_Filter_Function('twig_shortcodes'));
     $twig->addFilter('time_ago', new Twig_Filter_Function('twig_time_ago'));
     $twig->addFilter('twitterify', new Twig_Filter_Function(array('TimberHelper', 'twitterify')));
     $twig->addFilter('twitterfy', new Twig_Filter_Function(array('TimberHelper', 'twitterify')));
     $twig->addFilter('wp_body_class', new Twig_Filter_Function('twig_body_class'));
     $twig->addFilter('wpautop', new Twig_Filter_Function('wpautop'));
     $twig->addFilter('relative', new Twig_Filter_Function(function ($link) {
         return TimberHelper::get_rel_url($link, true);
     }));
     $twig->addFilter('truncate', new Twig_Filter_Function(function ($text, $len) {
         return TimberHelper::trim_words($text, $len);
     }));
     /* actions and filters */
     $twig->addFunction(new Twig_SimpleFunction('action', function () {
         call_user_func_array('do_action', func_get_args());
     }));
     $twig->addFilter(new Twig_SimpleFilter('apply_filters', function () {
         $args = func_get_args();
         $tag = current(array_splice($args, 1, 1));
         return apply_filters_ref_array($tag, $args);
     }));
     $twig->addFunction(new Twig_SimpleFunction('function', array(&$this, 'exec_function')));
     $twig->addFunction(new Twig_SimpleFunction('fn', array(&$this, 'exec_function')));
     /* TimberObjects */
     $twig->addFunction(new Twig_SimpleFunction('TimberPost', function ($pid, $PostClass = 'TimberPost') {
         if (is_array($pid) && !TimberHelper::is_array_assoc($pid)) {
             foreach ($pid as &$p) {
                 $p = new $PostClass($p);
             }
             return $pid;
         }
         return new $PostClass($pid);
     }));
     $twig->addFunction(new Twig_SimpleFunction('TimberImage', function ($pid, $ImageClass = 'TimberImage') {
         if (is_array($pid) && !TimberHelper::is_array_assoc($pid)) {
             foreach ($pid as &$p) {
                 $p = new $ImageClass($p);
             }
             return $pid;
         }
         return new $ImageClass($pid);
     }));
     $twig->addFunction(new Twig_SimpleFunction('TimberTerm', function ($pid, $TermClass = 'TimberTerm') {
         if (is_array($pid) && !TimberHelper::is_array_assoc($pid)) {
             foreach ($pid as &$p) {
                 $p = new $TermClass($p);
             }
             return $pid;
         }
         return new $TermClass($pid);
     }));
     /* bloginfo and translate */
     $twig->addFunction('bloginfo', new Twig_SimpleFunction('bloginfo', function ($show = '', $filter = 'raw') {
         return get_bloginfo($show, $filter);
     }));
     $twig->addFunction('__', new Twig_SimpleFunction('__', function ($text, $domain = 'default') {
         return __($text, $domain);
     }));
     $twig = apply_filters('get_twig', $twig);
     return $twig;
 }
開發者ID:pedrokoblitz,項目名稱:centro-dialogo-aberto,代碼行數:86,代碼來源:functions-twig.php

示例5: get_path

 function get_path()
 {
     return TimberHelper::get_rel_url($this->url);
 }
開發者ID:pedrokoblitz,項目名稱:centro-dialogo-aberto,代碼行數:4,代碼來源:timber-menu.php


注:本文中的TimberHelper::get_rel_url方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。