get_col( "SELECT blog_id FROM $wpdb->blogs" ); // phpcs:ignore foreach ( $blog_ids as $blog_id ) { switch_to_blog( $blog_id ); alm_create_table(); restore_current_blog(); } } else { alm_create_table(); } } register_activation_hook( __FILE__, 'alm_install' ); add_action( 'wpmu_new_blog', 'alm_install' ); if ( ! class_exists( 'AjaxLoadMore' ) ) : /** * Initiate the core AjaxLoadMore class. */ class AjaxLoadMore { /** * Shortcode attributes. * * @var array|null */ public static $shortcode_atts = null; /** * Class Constructor. */ public function __construct() { $this->alm_define_constants(); $this->alm_includes(); add_action( 'wp_ajax_alm_get_posts', [ $this, 'alm_query_posts' ] ); add_action( 'wp_ajax_nopriv_alm_get_posts', [ $this, 'alm_query_posts' ] ); add_action( 'wp_enqueue_scripts', [ $this, 'alm_enqueue_scripts' ] ); add_action( 'after_setup_theme', [ $this, 'alm_image_sizes' ] ); add_action( 'init', [ $this, 'alm_load_text_domain' ] ); add_filter( 'alm_noscript', [ $this, 'alm_noscript' ], 10, 6 ); add_filter( 'alm_noscript_pagination', [ $this, 'alm_noscript_pagination' ], 10, 3 ); add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), [ $this, 'alm_action_links' ] ); add_filter( 'plugin_row_meta', [ $this, 'alm_plugin_meta_links' ], 10, 2 ); add_filter( 'widget_text', 'do_shortcode' ); add_shortcode( 'ajax_load_more', [ $this, 'alm_shortcode' ] ); } /** * Load the plugin text domain for translation. * * @return void */ public function alm_load_text_domain() { load_plugin_textdomain( 'ajax-load-more', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' ); } /** * Load these files before the theme loads. * * @since 2.0.0 */ public function alm_includes() { require_once ALM_PATH . 'core/functions.php'; // Load Core Functions. require_once ALM_PATH . 'core/classes/class-alm-blocks.php'; // Load Block Class. require_once ALM_PATH . 'core/classes/class-alm-preview.php'; // Load Preview Class. require_once ALM_PATH . 'core/classes/class-alm-shortcode.php'; // Load Shortcode Class. require_once ALM_PATH . 'core/classes/class-alm-woocommerce.php'; // Load Woocommerce Class. require_once ALM_PATH . 'core/classes/class-alm-enqueue.php'; // Load Enqueue Class. require_once ALM_PATH . 'core/classes/class-alm-queryargs.php'; // Load Query Args Class. require_once ALM_PATH . 'core/classes/class-alm-localize.php'; // Load Class. require_once ALM_PATH . 'core/integration/elementor/elementor.php'; if ( is_admin() ) { require_once ALM_PATH . 'admin/admin.php'; require_once ALM_PATH . 'admin/admin-functions.php'; require_once ALM_PATH . 'admin/vendor/connekt-plugin-installer/class-connekt-plugin-installer.php'; if ( ! class_exists( 'EDD_SL_Plugin_Updater' ) ) { require_once ALM_PATH . '/core/libs/EDD_SL_Plugin_Updater.php'; // Include EDD helper if other plugins have not. } } } /** * Define plugin constants. * * @since 2.10.1 */ public function alm_define_constants() { define( 'ALM_PATH', plugin_dir_path( __FILE__ ) ); define( 'ALM_URL', plugins_url( '', __FILE__ ) ); define( 'ALM_ADMIN_URL', plugins_url( 'admin/', __FILE__ ) ); define( 'ALM_TITLE', 'Ajax Load More' ); define( 'ALM_SLUG', 'ajax-load-more' ); define( 'ALM_REST_NAMESPACE', 'ajaxloadmore' ); define( 'ALM_SETTINGS', 'alm_settings' ); // CSS constants. $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; define( 'ALM_CSS_PATH', ALM_PATH . 'build/frontend/ajax-load-more' . $suffix . '.css' ); define( 'ALM_CSS_URL', ALM_URL . '/build/frontend/ajax-load-more' . $suffix . '.css' ); define( 'ALM_CORE_JS_URL', ALM_URL . '/build/frontend/ajax-load-more' . $suffix . '.js' ); // Add-on constants. if ( ! defined( 'ALM_CACHE_ITEM_NAME' ) ) { define( 'ALM_CACHE_ITEM_NAME', '4878' ); } if ( ! defined( 'ALM_CTA_ITEM_NAME' ) ) { define( 'ALM_CTA_ITEM_NAME', '14456' ); } if ( ! defined( 'ALM_COMMENTS_ITEM_NAME' ) ) { define( 'ALM_COMMENTS_ITEM_NAME', '12172' ); } if ( ! defined( 'ALM_ELEMENTOR_ITEM_NAME' ) ) { define( 'ALM_ELEMENTOR_ITEM_NAME', '70951' ); } if ( ! defined( 'ALM_FILTERS_ITEM_NAME' ) ) { define( 'ALM_FILTERS_ITEM_NAME', '35992' ); } if ( ! defined( 'ALM_LAYOUTS_ITEM_NAME' ) ) { define( 'ALM_LAYOUTS_ITEM_NAME', '11398' ); } if ( ! defined( 'ALM_NEXTPAGE_ITEM_NAME' ) ) { define( 'ALM_NEXTPAGE_ITEM_NAME', '24540' ); } if ( ! defined( 'ALM_PAGING_ITEM_NAME' ) ) { define( 'ALM_PAGING_ITEM_NAME', '6898' ); } if ( ! defined( 'ALM_PRELOADED_ITEM_NAME' ) ) { define( 'ALM_PRELOADED_ITEM_NAME', '4293' ); } if ( ! defined( 'ALM_PREV_POST_ITEM_NAME' ) ) { define( 'ALM_PREV_POST_ITEM_NAME', '9686' ); } if ( ! defined( 'ALM_QUERY_LOOP_ITEM_NAME' ) ) { define( 'ALM_QUERY_LOOP_ITEM_NAME', '120900' ); } if ( ! defined( 'ALM_SEO_ITEM_NAME' ) ) { define( 'ALM_SEO_ITEM_NAME', '3482' ); } if ( ! defined( 'ALM_TEMPLATES_ITEM_NAME' ) ) { define( 'ALM_TEMPLATES_ITEM_NAME', '124259' ); } if ( ! defined( 'ALM_PRO_ITEM_NAME' ) ) { define( 'ALM_PRO_ITEM_NAME', '42166' ); } if ( ! defined( 'ALM_WOO_ITEM_NAME' ) ) { define( 'ALM_WOO_ITEM_NAME', '62770' ); } // Deprecated add-ons. if ( ! defined( 'ALM_UNLIMITED_ITEM_NAME' ) ) { define( 'ALM_UNLIMITED_ITEM_NAME', '3118' ); } if ( ! defined( 'ALM_THEME_REPEATERS_ITEM_NAME' ) ) { define( 'ALM_THEME_REPEATERS_ITEM_NAME', '8860' ); } // Deprecated. if ( ! defined( 'ALM_RESTAPI_ITEM_NAME' ) ) { define( 'ALM_RESTAPI_ITEM_NAME', '17105' ); } if ( ! defined( 'ALM_USERS_ITEM_NAME' ) ) { define( 'ALM_USERS_ITEM_NAME', '32311' ); } } /** * This function will build query results including pagination for users without JS enabled. * * @param array $args The alm_query args. * @param string $container_element The container HTML element. * @param string $css_classes ALM classes. * @param string $transition_classes Transition classes. * @param string $permalink The current permalink. * @return string The generated