PluginProbe ʕ •ᴥ•ʔ
Category Order and Taxonomy Terms Order / 1.9.4
Category Order and Taxonomy Terms Order v1.9.4
1.9.9.1 1.9.9 1.9.8 1.5.3.1 1.5.3.2 1.5.4 1.5.5 1.5.6 1.5.7 1.5.7.1 1.5.7.2 1.5.7.3 1.5.7.4 1.5.7.5 1.5.7.6 1.5.7.7 1.5.9 1.6 1.6.1 1.7 1.7.1 1.7.3 1.7.4 1.7.5 1.7.7 1.7.9 1.8 1.8.1 1.8.2 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.9 1.9.1 1.9.3 1.9.4 1.9.5 1.9.7 trunk 1.2.4 1.2.6 1.2.7 1.2.9 1.3.0 1.3.4 1.3.6 1.4.0 1.4.1 1.4.2 1.4.4 1.4.6 1.4.7 1.4.8 1.4.9 1.5 1.5.2.2 1.5.3
taxonomy-terms-order / include / class.functions.php
taxonomy-terms-order / include Last commit date
class.addons.php 3 months ago class.functions.php 3 months ago class.interface.php 3 months ago class.options.php 3 months ago class.terms_walker.php 3 months ago class.tto.php 3 months ago
class.functions.php
91 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
5 class TTO_functions
6 {
7 /**
8 * Return default plugin options
9 *
10 */
11 static public function get_settings()
12 {
13
14 $settings = get_option('tto_options');
15
16 $defaults = array (
17 'show_reorder_interfaces' => array(),
18 'capability' => 'manage_options',
19 'autosort' => '1',
20 'adminsort' => '1'
21 );
22 $settings = wp_parse_args( $settings, $defaults );
23
24 return $settings;
25
26 }
27
28
29 /**
30 * @desc
31 *
32 * Return UserLevel
33 *
34 */
35 static public function userdata_get_user_level($return_as_numeric = FALSE)
36 {
37 global $userdata;
38
39 $user_level = '';
40 for ($i=10; $i >= 0;$i--)
41 {
42 if (current_user_can('level_' . $i) === TRUE)
43 {
44 $user_level = $i;
45 if ($return_as_numeric === FALSE)
46 $user_level = 'level_'.$i;
47 break;
48 }
49 }
50 return ($user_level);
51 }
52
53
54 static public function check_table_column()
55 {
56 global $wpdb;
57
58 //check if the menu_order column exists;
59 $query = "SHOW COLUMNS FROM $wpdb->terms
60 LIKE 'term_order'";
61 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared WordPress.DB.DirectDatabaseQuery.DirectQuery
62 $result = $wpdb->query( $query );
63
64 if ($result == 0)
65 {
66 $query = "ALTER TABLE $wpdb->terms ADD `term_order` INT( 4 ) NULL DEFAULT '0'";
67 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared WordPress.DB.DirectDatabaseQuery.DirectQuery
68 $result = $wpdb->query($query);
69 }
70 }
71
72
73 static public function info_box()
74 {
75 ?>
76 <div id="cpt_info_box">
77 <p><?php esc_html_e( "Did you find this plugin useful? Please support our work by purchasing the advanced version or write an article about this plugin in your blog with a link to our site", 'taxonomy-terms-order' ) ?> <strong><a target="_blank" href="https://www.nsp-code.com/">https://www.nsp-code.com/</a></strong></p>
78 <h4><a href="https://www.nsp-code.com/premium-plugins/advanced-taxonomy-terms-order/" target="_blank"><img width="151" src="<?php echo esc_url ( TOURL . "/images/logo.png" ) ?>" class="attachment-large size-large wp-image-36927" alt=""></a> <?php esc_html_e( "Did you know there is an Advanced Version of this plug-in?", 'taxonomy-terms-order' ) ?> <a target="_blank" href="https://www.nsp-code.com/premium-plugins/advanced-taxonomy-terms-order/"><?php esc_html_e( "Read more", 'taxonomy-terms-order' ) ?></a></h4>
79 <p><?php esc_html_e( "Check our", 'taxonomy-terms-order' ) ?> <a target="_blank" href="https://wordpress.org/plugins/post-types-order/">Post Types Order</a> <?php esc_html_e( "plugin which allows to custom sort all posts, pages, custom post types", 'taxonomy-terms-order' ) ?> </p>
80 <p><?php esc_html_e('Check our', 'taxonomy-terms-order') ?> <a target="_blank" href="https://wordpress.org/plugins/post-terms-order/">Post Terms Order</a> <?php esc_html_e('plugin which allows to custom sort categories and custom taxonomies terms per post basis', 'taxonomy-terms-order') ?> </p>
81
82 <div class="clear"></div>
83 </div>
84
85 <?php
86 }
87
88 }
89
90
91 ?>