Plugin Directory

Changeset 2716398


Ignore:
Timestamp:
04/29/2022 02:18:02 PM (4 years ago)
Author:
jomres
Message:

Jomres updated to 10.3.0

Location:
jomres/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • jomres/trunk/includes/jomres.php

    r2309296 r2716398  
    11<?php
    2 /**
    3  * A class definition that includes attributes and functions used across both the
    4  * public-facing side of the site and the admin area.
    5  *
    6  * @package Jomres\Core\CMS_Specific
    7  *
    8  * @author   Vince Wooll <support@jomres.net>
    9  */
    10 class WP_Jomres {
    11 
    122    /**
    13      * The loader that's responsible for maintaining and registering all hooks that power
    14      * Jomres.
     3     * A class definition that includes attributes and functions used across both the
     4     * public-facing side of the site and the admin area.
    155     *
    16      * @since   9.9.19
    17      * @access   protected
    18      * @var   Jomres_Loader $loader Maintains and registers all Jomres hooks.
     6     * @package Jomres\Core\CMS_Specific
     7     *
     8     * @author   Vince Wooll <support@jomres.net>
    199     */
    20     protected $loader;
    21 
    22     /**
    23      * The Jomres plugin unique identifier.
    24      *
    25      * @since   9.9.19
    26      * @access   protected
    27      * @var   string    $plugin_name    The string used to uniquely identify the Jomres plugin.
    28      */
    29     protected $plugin_name;
    30 
    31     /**
    32      * The current Jomres version.
    33      *
    34      * @since   9.9.19
    35      * @access   protected
    36      * @var   string    $version    The current Jomres version.
    37      */
    38     protected $version;
    39    
    40     /**
    41      * The Jomres instance.
    42      *
    43      * @since   9.9.19
    44      * @access   protected
    45      * @var   object    $configInstance The Jomres instance.
    46      */
    47     private static $configInstance;
    48    
    49     /**
    50      * The Jomres javascript.
    51      *
    52      * @since   9.9.19
    53      * @access   private
    54      * @var   array $js The Jomres javascript.
    55      */
    56     private $js;
    57    
    58     /**
    59      * The Jomres css.
    60      *
    61      * @since   9.9.19
    62      * @access   private
    63      * @var   array $css    The Jomres css.
    64      */
    65     private $css;
    66    
    67     /**
    68      * The Jomres custom meta.
    69      *
    70      * @since   9.9.19
    71      * @access   private
    72      * @var   array $custom_meta    The Jomres custom meta.
    73      */
    74     private $custom_meta;
    75    
    76     /**
    77      * The Jomres output.
    78      *
    79      * @since   9.9.19
    80      * @access   private
    81      * @var   string    $content    The Jomres output.
    82      */
    83     private $content;
    84    
    85     /**
    86      * The Jomres page meta title.
    87      *
    88      * @since   9.9.19
    89      * @access   private
    90      * @var   string    $meta_title The Jomres page meta title.
    91      */
    92     private $meta_title;
    93 
    94     /**
    95      * Define the Jomres core functionality.
    96      *
    97      * Set the Jomres name and the Jomres version that can be used throughout the plugin.
    98      * Load the dependencies, define the locale, and set the hooks for the admin area and
    99      * the public-facing side of the site.
    100      *
    101      * @since   9.9.19
    102      */
    103     public function __construct() {
    104        
    105         if ( defined( 'JOMRES_WP_PLUGIN_VERSION' ) ) {
    106             $this->version = JOMRES_WP_PLUGIN_VERSION;
    107         } else {
    108             $this->version = '0';
    109         }
    110        
    111         $this->plugin_name = 'jomres';
    112         $this->js = array();
    113         $this->css = array();
    114         $this->custom_meta = array();
    115         $this->content = '';
    116         $this->meta_title = '';
    117 
    118         $this->load_dependencies();
    119         $this->define_common_hooks();
    120         $this->define_public_hooks();
    121        
    122         if ( is_admin() ) {
    123             $this->define_admin_hooks();
     10    class WP_Jomres {
     11
     12        /**
     13         * The loader that's responsible for maintaining and registering all hooks that power
     14         * Jomres.
     15         *
     16         * @since   9.9.19
     17         * @access   protected
     18         * @var   Jomres_Loader $loader Maintains and registers all Jomres hooks.
     19         */
     20        protected $loader;
     21
     22        /**
     23         * The Jomres plugin unique identifier.
     24         *
     25         * @since   9.9.19
     26         * @access   protected
     27         * @var   string    $plugin_name    The string used to uniquely identify the Jomres plugin.
     28         */
     29        protected $plugin_name;
     30
     31        /**
     32         * The current Jomres version.
     33         *
     34         * @since   9.9.19
     35         * @access   protected
     36         * @var   string    $version    The current Jomres version.
     37         */
     38        protected $version;
     39
     40        /**
     41         * The Jomres instance.
     42         *
     43         * @since   9.9.19
     44         * @access   protected
     45         * @var   object    $configInstance The Jomres instance.
     46         */
     47        private static $configInstance;
     48
     49        /**
     50         * The Jomres javascript.
     51         *
     52         * @since   9.9.19
     53         * @access   private
     54         * @var   array $js The Jomres javascript.
     55         */
     56        private $js;
     57
     58        /**
     59         * The Jomres css.
     60         *
     61         * @since   9.9.19
     62         * @access   private
     63         * @var   array $css    The Jomres css.
     64         */
     65        private $css;
     66
     67        /**
     68         * The Jomres custom meta.
     69         *
     70         * @since   9.9.19
     71         * @access   private
     72         * @var   array $custom_meta    The Jomres custom meta.
     73         */
     74        private $custom_meta;
     75
     76        /**
     77         * The Jomres output.
     78         *
     79         * @since   9.9.19
     80         * @access   private
     81         * @var   string    $content    The Jomres output.
     82         */
     83        private $content;
     84
     85        /**
     86         * The Jomres page meta title.
     87         *
     88         * @since   9.9.19
     89         * @access   private
     90         * @var   string    $meta_title The Jomres page meta title.
     91         */
     92        private $meta_title;
     93
     94        /**
     95         * Define the Jomres core functionality.
     96         *
     97         * Set the Jomres name and the Jomres version that can be used throughout the plugin.
     98         * Load the dependencies, define the locale, and set the hooks for the admin area and
     99         * the public-facing side of the site.
     100         *
     101         * @since   9.9.19
     102         */
     103        public function __construct() {
     104
     105            if ( defined( 'JOMRES_WP_PLUGIN_VERSION' ) ) {
     106                $this->version = JOMRES_WP_PLUGIN_VERSION;
     107            } else {
     108                $this->version = '0';
     109            }
     110
     111            $this->plugin_name = 'jomres';
     112            $this->js = array();
     113            $this->css = array();
     114            $this->custom_meta = array();
     115            $this->content = '';
     116            $this->meta_title = '';
     117
     118            $this->load_dependencies();
     119            $this->define_common_hooks();
     120            $this->define_public_hooks();
     121
     122            if ( is_admin() ) {
     123                $this->define_admin_hooks();
     124            }
     125
     126        }
     127
     128        /**
     129         * Get Jomres instance.
     130         *
     131         * Description.
     132         *
     133         * @since   9.9.19
     134         */
     135        public static function getInstance() {
     136
     137            if (!self::$configInstance) {
     138                self::$configInstance = new self();
     139            }
     140
     141            return self::$configInstance;
     142        }
     143
     144        /**
     145         * Load the required Jomres dependencies.
     146         *
     147         * Include the following files that make up the plugin:
     148         *
     149         * - Jomres_Loader. Orchestrates the hooks of the plugin.
     150         * - Jomres_i18n. Defines internationalization functionality.
     151         * - Jomres_Admin. Defines all hooks for the admin area.
     152         * - Jomres_Public. Defines all hooks for the public side of the site.
     153         *
     154         * Create an instance of the loader which will be used to register the hooks
     155         * with WordPress.
     156         *
     157         * @since   9.9.19
     158         * @access   private
     159         */
     160        private function load_dependencies() {
     161
     162            /**
     163             * The class responsible for orchestrating the Jomres actions and filters.
     164             */
     165            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/jomres-loader.php';
     166
     167            /**
     168             * The class responsible for defining all Jomres actions that occur in the admin area.
     169             */
     170            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/jomres-admin.php';
     171
     172            /**
     173             * The class responsible for defining all Jomres actions that occur in the public-facing
     174             * side of the site.
     175             */
     176            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/jomres-public.php';
     177
     178            $this->loader = new Jomres_Loader();
     179
     180        }
     181
     182        /**
     183         * Define the Jomres locale for internationalization.
     184         *
     185         * Uses the Jomres_i18n class in order to set the domain and to register the hook
     186         * with WordPress.
     187         *
     188         * @since   9.9.19
     189         * @access   private
     190         */
     191        private function set_locale() {
     192
     193            $plugin_i18n = new Jomres_i18n();
     194
     195            $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
     196
     197        }
     198
     199        /**
     200         * Register all of the common hooks related to the Jomres admin area and public-facing functionality.
     201         *
     202         * @since   9.9.19
     203         * @access   private
     204         */
     205        private function define_common_hooks() {
     206
     207            $this->loader->add_action( 'wp_login', $this, 'jomres_wp_end_session' );
     208            $this->loader->add_action( 'wp_logout', $this, 'jomres_wp_end_session' );
     209            $this->loader->add_action( 'wp_head', $this, 'jomres_add_custom_meta' );
     210
     211        }
     212
     213        /**
     214         * Register all of the hooks related to the Jomres admin area functionality.
     215         *
     216         * @since   9.9.19
     217         * @access   private
     218         */
     219        private function define_admin_hooks() {
     220
     221            $jomres_admin = new Jomres_Admin( $this->get_plugin_name(), $this->get_version(), $this->get_loader() );
     222
     223            $this->loader->add_action( 'admin_menu', $jomres_admin, 'register_jomres_admin_menu' );
     224
     225            if ( isset( $_REQUEST[ 'page' ] ) && $_REQUEST[ 'page' ] == 'jomres/jomres.php' ) {
     226                if ( ! defined( '_JOMRES_INITCHECK_ADMIN' ) ) {
     227                    define( '_JOMRES_INITCHECK_ADMIN', 1 );
     228                }
     229
     230                $this->loader->add_action( 'init', $jomres_admin, 'admin_trigger_jomres', 1 );
     231                $this->loader->add_action( 'wp_ajax_' . sanitize_text_field( $_REQUEST[ 'page' ] ), $jomres_admin, 'jomres_wp_ajax' );
     232            }
     233
     234            $this->loader->add_action( 'wp_ajax_jomres_ajax', $jomres_admin, 'jomres_wp_ajax' );
     235            $this->loader->add_action( 'wp_ajax_nopriv_jomres_ajax', $jomres_admin, 'jomres_wp_ajax' );
     236
     237        }
     238
     239        /**
     240         * Register all of the hooks related to the Jomres public-facing functionality.
     241         *
     242         * @since   9.9.19
     243         * @access   private
     244         */
     245        private function define_public_hooks() {
     246
     247            $jomres_public = new Jomres_Public( $this->get_plugin_name(), $this->get_version(), $this->get_loader() );
     248
     249            $this->loader->add_action( 'wp', $jomres_public, 'frontend_trigger_jomres', 1 );
     250
     251            $this->loader->add_filter( 'the_content', $jomres_public, 'asamodule_search_results' );
     252            $this->loader->add_filter( 'wp_title', $jomres_public, 'set_jomres_meta_title' );
     253            $this->loader->add_filter( 'redirect_canonical', $jomres_public, 'payments_redirect_canonical', 10, 2 );
     254
     255            //if &popup=1 is in $_REQUEST we'll disable all widgets, but leave the keys intact so that you don't get the "please activate a widget" message
     256            if ( isset($_REQUEST['popup']) && (int)$_REQUEST['popup'] == 1 ) {
     257                $this->loader->add_filter( 'sidebars_widgets', $jomres_public, 'disable_all_widgets' );
     258            }
     259
     260            //fullscreen view
     261            if ( isset($_GET['tmpl']) && $_GET['tmpl'] == 'jomres' ) {
     262                $this->loader->add_filter( 'template_include', $jomres_public, 'jomres_fullscreen_view' );
     263            }
     264
     265        }
     266
     267        /**
     268         * Register all scripts and styles related to the Jomres andmin and public-facing functionality.
     269         *
     270         * @since   9.9.19
     271         * @access   public
     272         */
     273        public function add_jomres_js_css() {
     274
     275            if ( ! empty( $this->js )) {
     276                foreach ( $this->js as $js_filename => $js ) {
     277                    if (is_admin()) {
     278                        if ( strpos( $js['0'], 'jomres.js' ) ) {
     279                            wp_register_script( $js_filename, $js['0'], array('jquery' ), $js['1'] );
     280                        } else {
     281                            wp_register_script( $js_filename, $js['0'], array('jquery' ), $js['1'], true );
     282                        }
     283                    } else {
     284                        if ( strpos( $js['0'], 'jomres.js' ) ) {
     285                            wp_register_script( $js_filename, $js['0'], array('jquery' , 'bootstrap'), $js['1'], false );
     286                        } else {
     287                            wp_register_script( $js_filename, $js['0'], array('jquery' , 'bootstrap'), $js['1'], false );
     288                        }
     289                    }
     290
     291
     292                    wp_enqueue_script( $js_filename );
     293                }
     294
     295                $this->js = array();
     296            }
     297
     298            if ( ! empty( $this->css ) ) {
     299                foreach ( $this->css as $css_filename => $css ) {
     300                    wp_register_style( $css_filename, $css['0'], array(), $css['1'], 'all' );
     301                    wp_enqueue_style( $css_filename );
     302                }
     303
     304                $this->css = array();
     305            }
     306
     307        }
     308
     309        /**
     310         * Clear the Jomres session data.
     311         *
     312         * @since   9.9.19
     313         * @access   private
     314         */
     315        public function jomres_wp_end_session() {
     316
     317            $_SESSION['jomres_wp_session'] = array();
     318
     319        }
     320
     321        /**
     322         * Echoes the Jomres custom meta data.
     323         *
     324         * @since   9.9.19
     325         * @access   private
     326         */
     327        public function jomres_add_custom_meta() {
     328
     329            if ( empty($this->custom_meta) ) {
     330                return true;
     331            }
     332
     333            echo PHP_EOL;
     334
     335            foreach ( $this->custom_meta as $meta ) {
     336                echo $meta . PHP_EOL;
     337            }
     338
     339            return true;
     340        }
     341
     342        /**
     343         * Run the loader to execute all of the hooks with WordPress.
     344         *
     345         * @since   9.9.19
     346         */
     347        public function run() {
     348
     349            $this->loader->run();
     350
     351        }
     352
     353        /**
     354         * The name of the plugin used to uniquely identify it within the context of
     355         * WordPress and to define internationalization functionality.
     356         *
     357         * @since    9.9.19
     358         * @return  string  The name of the plugin.
     359         */
     360        public function get_plugin_name() {
     361
     362            return $this->plugin_name;
     363
     364        }
     365
     366        /**
     367         * The reference to the class that orchestrates the hooks with the plugin.
     368         *
     369         * @since    9.9.19
     370         * @return  Jomres_Loader   Orchestrates the hooks of the plugin.
     371         */
     372        public function get_loader() {
     373
     374            return $this->loader;
     375
     376        }
     377
     378        /**
     379         * Retrieve the Jomres version number.
     380         *
     381         * @since    9.9.19
     382         * @return  string  The Jomres version number.
     383         */
     384        public function get_version() {
     385
     386            return $this->version;
     387
     388        }
     389
     390        /**
     391         * Retrieve the Jomres js.
     392         *
     393         * @since    9.9.19
     394         * @return  array   The Jomres js.
     395         */
     396        public function get_js() {
     397
     398            return $this->js;
     399
     400        }
     401
     402        /**
     403         * Retrieve the Jomres css.
     404         *
     405         * @since    9.9.19
     406         * @return  array   The Jomres css.
     407         */
     408        public function get_css() {
     409
     410            return $this->css;
     411
     412        }
     413
     414        /**
     415         * Retrieve the Jomres custom meta.
     416         *
     417         * @since    9.9.19
     418         * @return  array   The Jomres custom meta.
     419         */
     420        public function get_custom_meta() {
     421
     422            return $this->custom_meta;
     423
     424        }
     425
     426        /**
     427         * Retrieve the Jomres output.
     428         *
     429         * @since    9.9.19
     430         * @return  string  The Jomres output.
     431         */
     432        public function get_content() {
     433
     434            return $this->content;
     435
     436        }
     437
     438        /**
     439         * Retrieve the Jomres page metta title.
     440         *
     441         * @since    9.9.19
     442         * @return  array   The Jomres page meta title.
     443         */
     444        public function get_meta_title() {
     445
     446            return $this->meta_title;
     447
     448        }
     449
     450        /**
     451         * Retrieve the Jomres output.
     452         *
     453         * @since    9.9.19
     454         * @return  bool    true.
     455         */
     456        public function set_content($content) {
     457
     458            $this->content = $content;
     459
     460            return true;
     461
     462        }
     463
     464        /**
     465         * Adds javascript files to $js array.
     466         *
     467         * @since    9.9.19
     468         * @return  bool    true.
     469         */
     470        public function add_js( $filename, $js, $version ) {
     471
     472            $this->js[ $filename ] = array( $js, $version );
     473
     474            return true;
     475
     476        }
     477
     478        /**
     479         * Adds javascript files to $js array.
     480         *
     481         * @since    9.9.19
     482         * @return  bool    true.
     483         */
     484        public function add_css( $filename, $css, $version ) {
     485
     486            $this->css[ $filename ] = array( $css, $version );
     487
     488            return true;
     489
     490        }
     491
     492        /**
     493         * Adds custom meta data cu $custom_meta array.
     494         *
     495         * @since    9.9.19
     496         * @return  bool    true.
     497         */
     498        public function add_custom_meta( $meta ) {
     499
     500            $this->custom_meta[] = $meta;
     501
     502            return true;
     503
     504        }
     505
     506        /**
     507         * Sets the Jomres page meta title.
     508         *
     509         * @since    9.9.19
     510         * @return  bool    true.
     511         */
     512        public function set_meta_title( $title ) {
     513
     514            $this->meta_title = trim( $title );
     515
     516            return true;
     517
    124518        }
    125519
    126520    }
    127    
    128     /**
    129      * Get Jomres instance.
    130      *
    131      * Description.
    132      *
    133      * @since   9.9.19
    134      */
    135     public static function getInstance() {
    136 
    137         if (!self::$configInstance) {
    138             self::$configInstance = new self();
    139         }
    140 
    141         return self::$configInstance;
    142     }
    143 
    144     /**
    145      * Load the required Jomres dependencies.
    146      *
    147      * Include the following files that make up the plugin:
    148      *
    149      * - Jomres_Loader. Orchestrates the hooks of the plugin.
    150      * - Jomres_i18n. Defines internationalization functionality.
    151      * - Jomres_Admin. Defines all hooks for the admin area.
    152      * - Jomres_Public. Defines all hooks for the public side of the site.
    153      *
    154      * Create an instance of the loader which will be used to register the hooks
    155      * with WordPress.
    156      *
    157      * @since   9.9.19
    158      * @access   private
    159      */
    160     private function load_dependencies() {
    161 
    162         /**
    163          * The class responsible for orchestrating the Jomres actions and filters.
    164          */
    165         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/jomres-loader.php';
    166 
    167         /**
    168          * The class responsible for defining all Jomres actions that occur in the admin area.
    169          */
    170         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/jomres-admin.php';
    171 
    172         /**
    173          * The class responsible for defining all Jomres actions that occur in the public-facing
    174          * side of the site.
    175          */
    176         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/jomres-public.php';
    177 
    178         $this->loader = new Jomres_Loader();
    179 
    180     }
    181 
    182     /**
    183      * Define the Jomres locale for internationalization.
    184      *
    185      * Uses the Jomres_i18n class in order to set the domain and to register the hook
    186      * with WordPress.
    187      *
    188      * @since   9.9.19
    189      * @access   private
    190      */
    191     private function set_locale() {
    192 
    193         $plugin_i18n = new Jomres_i18n();
    194 
    195         $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
    196 
    197     }
    198    
    199     /**
    200      * Register all of the common hooks related to the Jomres admin area and public-facing functionality.
    201      *
    202      * @since   9.9.19
    203      * @access   private
    204      */
    205     private function define_common_hooks() {
    206        
    207         $this->loader->add_action( 'wp_login', $this, 'jomres_wp_end_session' );
    208         $this->loader->add_action( 'wp_logout', $this, 'jomres_wp_end_session' );
    209         $this->loader->add_action( 'wp_head', $this, 'jomres_add_custom_meta' );
    210        
    211     }
    212 
    213     /**
    214      * Register all of the hooks related to the Jomres admin area functionality.
    215      *
    216      * @since   9.9.19
    217      * @access   private
    218      */
    219     private function define_admin_hooks() {
    220 
    221         $jomres_admin = new Jomres_Admin( $this->get_plugin_name(), $this->get_version(), $this->get_loader() );
    222 
    223         $this->loader->add_action( 'admin_menu', $jomres_admin, 'register_jomres_admin_menu' );
    224        
    225         if ( isset( $_REQUEST[ 'page' ] ) && $_REQUEST[ 'page' ] == 'jomres/jomres.php' ) {
    226             if ( ! defined( '_JOMRES_INITCHECK_ADMIN' ) ) {
    227                 define( '_JOMRES_INITCHECK_ADMIN', 1 );
    228             }
    229 
    230             $this->loader->add_action( 'init', $jomres_admin, 'admin_trigger_jomres', 1 );
    231             $this->loader->add_action( 'wp_ajax_' . sanitize_text_field( $_REQUEST[ 'page' ] ), $jomres_admin, 'jomres_wp_ajax' );
    232         }
    233 
    234         $this->loader->add_action( 'wp_ajax_jomres_ajax', $jomres_admin, 'jomres_wp_ajax' );
    235         $this->loader->add_action( 'wp_ajax_nopriv_jomres_ajax', $jomres_admin, 'jomres_wp_ajax' );
    236 
    237     }
    238 
    239     /**
    240      * Register all of the hooks related to the Jomres public-facing functionality.
    241      *
    242      * @since   9.9.19
    243      * @access   private
    244      */
    245     private function define_public_hooks() {
    246 
    247         $jomres_public = new Jomres_Public( $this->get_plugin_name(), $this->get_version(), $this->get_loader() );
    248 
    249         $this->loader->add_action( 'wp', $jomres_public, 'frontend_trigger_jomres', 1 );
    250        
    251         $this->loader->add_filter( 'the_content', $jomres_public, 'asamodule_search_results' );
    252         $this->loader->add_filter( 'wp_title', $jomres_public, 'set_jomres_meta_title' );
    253         $this->loader->add_filter( 'redirect_canonical', $jomres_public, 'payments_redirect_canonical', 10, 2 );
    254        
    255         //if &popup=1 is in $_REQUEST we'll disable all widgets, but leave the keys intact so that you don't get the "please activate a widget" message
    256         if ( isset($_REQUEST['popup']) && (int)$_REQUEST['popup'] == 1 ) {
    257             $this->loader->add_filter( 'sidebars_widgets', $jomres_public, 'disable_all_widgets' );
    258         }
    259        
    260         //fullscreen view
    261         if ( isset($_GET['tmpl']) && $_GET['tmpl'] == 'jomres' ) {
    262             $this->loader->add_filter( 'template_include', $jomres_public, 'jomres_fullscreen_view' );
    263         }
    264 
    265     }
    266    
    267     /**
    268      * Register all scripts and styles related to the Jomres andmin and public-facing functionality.
    269      *
    270      * @since   9.9.19
    271      * @access   public
    272      */
    273     public function add_jomres_js_css() {
    274 
    275         if ( ! empty( $this->js )) {
    276             foreach ( $this->js as $js_filename => $js ) {
    277                 if ( strpos( $js['0'], 'jomres.js' ) ) {
    278                     wp_register_script( $js_filename, $js['0'], array('jquery'), $js['1'] );
    279                 } else {
    280                     wp_register_script( $js_filename, $js['0'], array('jquery'), $js['1'], true );
    281                 }
    282 
    283                 wp_enqueue_script( $js_filename );
    284             }
    285 
    286             $this->js = array();
    287         }
    288 
    289         if ( ! empty( $this->css ) ) {
    290             foreach ( $this->css as $css_filename => $css ) {
    291                 wp_register_style( $css_filename, $css['0'], array(), $css['1'], 'all' );
    292                 wp_enqueue_style( $css_filename );
    293             }
    294 
    295             $this->css = array();
    296         }
    297        
    298     }
    299    
    300     /**
    301      * Clear the Jomres session data.
    302      *
    303      * @since   9.9.19
    304      * @access   private
    305      */
    306     public function jomres_wp_end_session() {
    307        
    308         $_SESSION['jomres_wp_session'] = array();
    309        
    310     }
    311    
    312     /**
    313      * Echoes the Jomres custom meta data.
    314      *
    315      * @since   9.9.19
    316      * @access   private
    317      */
    318     public function jomres_add_custom_meta() {
    319    
    320         if ( empty($this->custom_meta) ) {
    321             return true;
    322         }
    323 
    324         echo PHP_EOL;
    325 
    326         foreach ( $this->custom_meta as $meta ) {
    327             echo $meta . PHP_EOL;
    328         }
    329 
    330         return true;
    331     }
    332 
    333     /**
    334      * Run the loader to execute all of the hooks with WordPress.
    335      *
    336      * @since   9.9.19
    337      */
    338     public function run() {
    339        
    340         $this->loader->run();
    341    
    342     }
    343 
    344     /**
    345      * The name of the plugin used to uniquely identify it within the context of
    346      * WordPress and to define internationalization functionality.
    347      *
    348      * @since    9.9.19
    349      * @return  string  The name of the plugin.
    350      */
    351     public function get_plugin_name() {
    352        
    353         return $this->plugin_name;
    354    
    355     }
    356 
    357     /**
    358      * The reference to the class that orchestrates the hooks with the plugin.
    359      *
    360      * @since    9.9.19
    361      * @return  Jomres_Loader   Orchestrates the hooks of the plugin.
    362      */
    363     public function get_loader() {
    364        
    365         return $this->loader;
    366    
    367     }
    368 
    369     /**
    370      * Retrieve the Jomres version number.
    371      *
    372      * @since    9.9.19
    373      * @return  string  The Jomres version number.
    374      */
    375     public function get_version() {
    376        
    377         return $this->version;
    378    
    379     }
    380    
    381     /**
    382      * Retrieve the Jomres js.
    383      *
    384      * @since    9.9.19
    385      * @return  array   The Jomres js.
    386      */
    387     public function get_js() {
    388        
    389         return $this->js;
    390    
    391     }
    392    
    393     /**
    394      * Retrieve the Jomres css.
    395      *
    396      * @since    9.9.19
    397      * @return  array   The Jomres css.
    398      */
    399     public function get_css() {
    400        
    401         return $this->css;
    402    
    403     }
    404    
    405     /**
    406      * Retrieve the Jomres custom meta.
    407      *
    408      * @since    9.9.19
    409      * @return  array   The Jomres custom meta.
    410      */
    411     public function get_custom_meta() {
    412        
    413         return $this->custom_meta;
    414    
    415     }
    416    
    417     /**
    418      * Retrieve the Jomres output.
    419      *
    420      * @since    9.9.19
    421      * @return  string  The Jomres output.
    422      */
    423     public function get_content() {
    424        
    425         return $this->content;
    426    
    427     }
    428    
    429     /**
    430      * Retrieve the Jomres page metta title.
    431      *
    432      * @since    9.9.19
    433      * @return  array   The Jomres page meta title.
    434      */
    435     public function get_meta_title() {
    436        
    437         return $this->meta_title;
    438    
    439     }
    440    
    441     /**
    442      * Retrieve the Jomres output.
    443      *
    444      * @since    9.9.19
    445      * @return  bool    true.
    446      */
    447     public function set_content($content) {
    448        
    449         $this->content = $content;
    450        
    451         return true;
    452    
    453     }
    454    
    455     /**
    456      * Adds javascript files to $js array.
    457      *
    458      * @since    9.9.19
    459      * @return  bool    true.
    460      */
    461     public function add_js( $filename, $js, $version ) {
    462        
    463         $this->js[ $filename ] = array( $js, $version );
    464        
    465         return true;
    466    
    467     }
    468    
    469     /**
    470      * Adds javascript files to $js array.
    471      *
    472      * @since    9.9.19
    473      * @return  bool    true.
    474      */
    475     public function add_css( $filename, $css, $version ) {
    476        
    477         $this->css[ $filename ] = array( $css, $version );
    478        
    479         return true;
    480    
    481     }
    482    
    483     /**
    484      * Adds custom meta data cu $custom_meta array.
    485      *
    486      * @since    9.9.19
    487      * @return  bool    true.
    488      */
    489     public function add_custom_meta( $meta ) {
    490        
    491         $this->custom_meta[] = $meta;
    492        
    493         return true;
    494    
    495     }
    496    
    497     /**
    498      * Sets the Jomres page meta title.
    499      *
    500      * @since    9.9.19
    501      * @return  bool    true.
    502      */
    503     public function set_meta_title( $title ) {
    504        
    505         $this->meta_title = trim( $title );
    506        
    507         return true;
    508    
    509     }
    510 
    511 }
  • jomres/trunk/jomres.php

    r2681492 r2716398  
    1717 * Plugin URI:      https://www.jomres.net
    1818 * Description:    The complete online booking and property management solution for WordPress.
    19  * Version:        10.2.2
     19 * Version:        10.3.0
    2020 * Author:          Vince Wooll <support@jomres.net>
    2121 * Author URI:      https://www.jomres.net
     
    3535 */
    3636if ( ! defined( 'JOMRES_WP_PLUGIN_VERSION' ) ) {
    37     define( 'JOMRES_WP_PLUGIN_VERSION', '10.2.2' );
     37    define( 'JOMRES_WP_PLUGIN_VERSION', '10.3.0' );
    3838}
    3939
  • jomres/trunk/readme.txt

    r2681391 r2716398  
    3131== What's new? ==
    3232
     33= Bootstrap 5 =
     34
     35Jomres 10.3.0 is fully compatible with Bootstrap 5 on Wordpress.
     36
    3337= Bootstrap no longer required =
    3438
     
    3741
    3842== Demos ==
    39 
    40 [See the Single Hotel Demo here](http://wordpress-hotel.jomres.net/)
    4143
    4244[See the Portal Demo here - a variety of bookable items, multiple owners](http://wordpress-portal.jomres.net/)
Note: See TracChangeset for help on using the changeset viewer.