Skip to content

Commit

Permalink
20211220
Browse files Browse the repository at this point in the history
  • Loading branch information
owen0o0 committed Dec 20, 2021
1 parent 45fea0c commit b3f85dc
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion inc/frame/classes/metabox.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function render_meta_box_content( $post, $callback ) {
$default = ( isset( $field['default'] ) ) ? $field['default'] : '';
$elem_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
if($callback['args']['data_type'] !== 'serialize' ) {//iotheme.cn
$elem_value = get_term_meta($post->ID, $elem_id,true);
$elem_value = get_post_meta($post->ID, $elem_id,true);
}else{
$elem_value = ( is_array( $meta_value ) && isset( $meta_value[$elem_id] ) ) ? $meta_value[$elem_id] : $default;
}//iotheme.cn
Expand Down
11 changes: 10 additions & 1 deletion inc/frame/functions/fallback.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
/*
* @Author: iowen
* @Author URI: https://www.iowen.cn/
* @Date: 2020-02-22 21:26:04
* @LastEditors: iowen
* @LastEditTime: 2021-12-20 22:47:45
* @FilePath: \WebStack\inc\frame\functions\fallback.php
* @Description:
*/
/**
*
* A fallback for get term meta
Expand Down Expand Up @@ -28,7 +37,7 @@ function get_term_meta( $term_id, $key = '', $single = false ) {
*
*/
if( ! function_exists( 'add_term_meta' ) ) {
function add_term_meta( $term_id, $meta_key = '', $meta_value, $unique = false ) {
function add_term_meta( $term_id, $meta_key = '', $meta_value = '', $unique = false ) {

return update_term_meta( $term_id, $meta_key, $meta_value, $unique );

Expand Down
14 changes: 7 additions & 7 deletions inc/inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @Author URI: https://www.iowen.cn/
* @Date: 2019-02-22 21:26:02
* @LastEditors: iowen
* @LastEditTime: 2021-08-22 23:20:28
* @LastEditTime: 2021-12-20 23:48:24
* @FilePath: \WebStack\inc\inc.php
* @Description:
*/
Expand Down Expand Up @@ -524,8 +524,8 @@ function searchfilter($query) {
*/
add_filter('posts_join', 'cf_search_join' );
function cf_search_join( $join ) {
if(is_admin())
return $join;
//if(is_admin())
// return $join;
global $wpdb;
if ( is_search() ) {
$join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';
Expand All @@ -538,8 +538,8 @@ function cf_search_join( $join ) {
*/
add_filter('posts_where', 'cf_search_where');
function cf_search_where( $where ) {
if(is_admin())
return $where;
//if(is_admin())
// return $where;
global $pagenow, $wpdb;
if ( is_search() ) {
$where = preg_replace("/\(\s*".$wpdb->posts.".post_title\s+LIKE\s*(\'[^\']+\')\s*\)/",
Expand All @@ -553,8 +553,8 @@ function cf_search_where( $where ) {
*/
add_filter ('posts_distinct', 'cf_search_distinct');
function cf_search_distinct($where) {
if(is_admin())
return $where;
//if(is_admin())
// return $where;
global $wpdb;
if ( is_search() ) {
return "DISTINCT";
Expand Down
7 changes: 6 additions & 1 deletion inc/post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @Author URI: https://www.iowen.cn/
* @Date: 2020-02-22 21:26:05
* @LastEditors: iowen
* @LastEditTime: 2021-08-22 21:47:11
* @LastEditTime: 2021-12-20 23:53:13
* @FilePath: \WebStack\inc\post-type.php
* @Description:
*/
Expand Down Expand Up @@ -218,12 +218,17 @@ function io_work_convert_restrict($query) {
add_filter('manage_edit-sites_columns', 'io_ordinal_manage_posts_columns');
add_action('manage_posts_custom_column','io_ordinal_manage_posts_custom_column',10,2);
function io_ordinal_manage_posts_columns($columns){
$columns['link'] = '链接';
$columns['ordinal'] = '排序';
$columns['visible'] = '可见性';
return $columns;
}
function io_ordinal_manage_posts_custom_column($column_name,$id){
switch( $column_name ) :
case 'link': {
echo get_post_meta($id, '_sites_link', true);
break;
}
case 'ordinal': {
echo get_post_meta($id, '_sites_order', true);
break;
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Theme Name:WebStack
Theme URI:https://www.iotheme.cn
Description:wordpress 导航主题!官方网站:<a href="https://www.iotheme.cn">一为主题</a>,</br><a href="https://www.iotheme.cn/store/onenav.html">升级pro版</a>,体验更多功能
Version:1.1522
Version:1.1620
Requires at least: 5.4
Tested up to: 5.8
Requires PHP: 5.6
Expand Down

0 comments on commit b3f85dc

Please sign in to comment.