<?php /*-----------------------------------------------------------------------------------*/ /* Options Framework Functions /*-----------------------------------------------------------------------------------*/ /* Set the file path based on whether the Options Framework is in a parent theme or child theme */ //连接数量 $match_num_from = 1; //一个关键字少于多少不替换 $match_num_to = 5; //一个关键字最多替换 //连接到WordPress的模块 add_filter('the_content','tag_link',1); //按长度排序 function tag_sort($a, $b){ if ( $a->name == $b->name ) return 0; return ( strlen($a->name) > strlen($b->name) ) ? -1 : 1; } //改变标签关键字 function tag_link($content){ global $match_num_from,$match_num_to; $posttags = get_the_tags(); if ($posttags) { usort($posttags, "tag_sort"); foreach($posttags as $tag) { $link = get_tag_link($tag->term_id); $keyword = $tag->name; //连接代码 $cleankeyword = stripslashes($keyword); $url = "<a href=\"$link\" title=\"".str_replace('%s',addcslashes($cleankeyword, '$'),__('View all posts in %s'))."\""; $url .= 'target="_blank"'; $url .= ">".addcslashes($cleankeyword, '$')."</a>"; $limit = rand($match_num_from,$match_num_to); //不连接的代码 $content = preg_replace( '|(<a[^>]+>)(.*)('.$ex_word.')(.*)(</a[^>]*>)|U'.$case, '$1$2%&&&&&%$4$5', $content); $content = preg_replace( '|(<img)(.*?)('.$ex_word.')(.*?)(>)|U'.$case, '$1$2%&&&&&%$4$5', $content); $cleankeyword = preg_quote($cleankeyword,'\''); $regEx = '\'(?!((<.*?)|(<a.*?)))('. $cleankeyword . ')(?!(([^<>]*?)>)|([^>]*?</a>))\'s' . $case; $content = preg_replace($regEx,$url,$content,$limit); $content = str_replace( '%&&&&&%', stripslashes($ex_word), $content); } } return $content; } if ( STYLESHEETPATH == TEMPLATEPATH ) { define('OF_FILEPATH', TEMPLATEPATH); define('OF_DIRECTORY', get_template_directory_uri()); } else { define('OF_FILEPATH', STYLESHEETPATH); define('OF_DIRECTORY', get_stylesheet_directory_uri()); } /* These files build out the options interface. Likely won't need to edit these. */ require_once (OF_FILEPATH . '/admin/admin-functions.php'); // Custom functions and plugins require_once (OF_FILEPATH . '/admin/admin-interface.php'); // Admin Interfaces (options,framework, seo) /* These files build out the theme specific options and associated functions. */ require_once (OF_FILEPATH . '/admin/theme-options.php'); // Options panel settings and custom settings require_once (OF_FILEPATH . '/functions/theme-functions.php'); // Theme actions based on options settings require_once (OF_FILEPATH . '/functions/metabox.php'); require_once (OF_FILEPATH . '/functions/post-types.php'); require_once (OF_FILEPATH . '/functions/theme-widgets.php'); require_once (OF_FILEPATH . '/functions/shortcodes.php'); require_once (OF_FILEPATH . '/admin/tinymce/shortcodes-generator.php'); // Load static framework options pages $functions_path = OF_FILEPATH . '/admin/'; function optionsframework_add_admin() { global $query_string; $themename = get_option('of_themename'); $shortname = get_option('of_shortname'); if ( isset($_REQUEST['page']) && $_REQUEST['page'] == 'optionsframework' ) { if (isset($_REQUEST['of_save']) && 'reset' == $_REQUEST['of_save']) { $options = get_option('of_template'); of_reset_options($options,'optionsframework'); header("Location: admin.php?page=optionsframework&reset=true"); die; } } //$of_page = add_submenu_page('themes.php', $themename, 'Theme Options', 'edit_theme_options', 'optionsframework','optionsframework_options_page'); // Default $of_page = add_menu_page($themename." Options", $themename, 'edit_themes', 'optionsframework', 'optionsframework_options_page'); // Add framework functionaily to the head individually add_action("admin_print_scripts-$of_page", 'of_load_only'); add_action("admin_print_styles-$of_page",'of_style_only'); } add_action('admin_menu', 'optionsframework_add_admin'); ?> ?> {"id":3845,"count":1,"description":"","link":"https:\/\/www.stamping.cc\/index.php\/tag\/dosiereinheitgehaeuse\/","name":"Dosiereinheitgeh\u00e4use","slug":"dosiereinheitgehaeuse","taxonomy":"post_tag","meta":[],"_links":{"self":[{"href":"https:\/\/www.stamping.cc\/index.php\/wp-json\/wp\/v2\/tags\/3845"}],"collection":[{"href":"https:\/\/www.stamping.cc\/index.php\/wp-json\/wp\/v2\/tags"}],"about":[{"href":"https:\/\/www.stamping.cc\/index.php\/wp-json\/wp\/v2\/taxonomies\/post_tag"}],"wp:post_type":[{"href":"https:\/\/www.stamping.cc\/index.php\/wp-json\/wp\/v2\/posts?tags=3845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}