PluginProbe ʕ •ᴥ•ʔ
Starter Sites & Templates by Neve / trunk
Starter Sites & Templates by Neve vtrunk
1.4.0 1.3.0 1.2.29 1.2.28 1.2.6 1.2.7 1.2.8 1.2.9 trunk 1.0.10 1.0.11 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 1.1.20 1.1.21 1.1.22 1.1.23 1.1.24 1.1.25 1.1.26 1.1.27 1.1.28 1.1.29 1.1.3 1.1.30 1.1.31 1.1.32 1.1.33 1.1.34 1.1.35 1.1.36 1.1.37 1.1.38 1.1.39 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.3 1.2.4 1.2.5
templates-patterns-collection / templates-patterns-collection.php
templates-patterns-collection Last commit date
assets 2 weeks ago beaver 1 year ago e2e-tests 1 week ago editor 1 year ago elementor 1 year ago includes 1 week ago languages 1 week ago migration 5 years ago onboarding 1 week ago shared 2 years ago vendor 1 week ago .browserslistrc 1 year ago .eslintrc 1 year ago AGENTS.md 1 week ago CHANGELOG.md 1 week ago CONTRIBUTING.md 2 years ago README.md 1 week ago phpstan.neon 2 weeks ago readme.txt 1 week ago templates-patterns-collection.php 1 week ago yarn.lock 1 year ago
templates-patterns-collection.php
98 lines
1 <?php
2 /**
3 * Plugin Name: Starter Sites & Templates by Neve
4 * Description: This plugin gives you access to 100+ templates and ready-to-use starter sites. Neve theme is used for all the designs.
5 * Version: 1.4.0
6 * Author: Themeisle
7 * Author URI: https://themeisle.com
8 * License: GPLv3
9 * License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
10 * Text Domain: templates-patterns-collection
11 * Domain Path: /languages
12 * WordPress Available: yes
13 * Requires License: no
14 *
15 * @package templates-patterns-collection
16 */
17
18 add_action( 'init', 'ti_tpc_load_textdomain' );
19 add_action( 'init', 'ti_tpc_flush_premalinks' );
20
21 /**
22 * Flush the permalinks after import
23 *
24 */
25 function ti_tpc_flush_premalinks() {
26 $flash_rules = get_transient( 'ti_tpc_should_flush_permalinks' );
27 if ( $flash_rules !== 'yes' ) {
28 return false;
29 }
30
31 flush_rewrite_rules();
32 delete_transient( 'ti_tpc_should_flush_permalinks' );
33
34 return true;
35 }
36
37 add_filter( 'themeisle_sdk_products', 'tpc_load_sdk' );
38
39 /**
40 * Filter products array.
41 *
42 * @param array $products products array.
43 *
44 * @return array
45 */
46 function tpc_load_sdk( $products ) {
47 $products[] = __FILE__;
48 return $products;
49 }
50 /**
51 * Load the localisation file.
52 */
53 function ti_tpc_load_textdomain() {
54 load_plugin_textdomain( 'templates-patterns-collection', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
55 }
56
57 define( 'TIOB_VERSION', '1.4.0' );
58 define( 'TIOB_URL', plugin_dir_url( __FILE__ ) );
59 define( 'TIOB_PATH', dirname( __FILE__ ) . '/' );
60 define( 'TIOB_BASENAME', plugin_basename( __FILE__ ) );
61
62 $autoload_path = __DIR__ . '/vendor/autoload.php';
63 if ( is_file( $autoload_path ) ) {
64 require_once $autoload_path;
65 }
66 add_action( 'init', 'ti_tpc_run', 999 );
67
68 function ti_tpc_run() {
69 if ( ! defined( 'TI_ONBOARDING_DISABLED' ) ) {
70 define( 'TI_ONBOARDING_DISABLED', false );
71 }
72
73 if ( class_exists( 'WP_CLI' ) ) {
74 require_once 'includes/WP_Cli.php';
75 }
76
77 define(
78 'TIOB_FEATURES',
79 array(
80 'new_menu' => true,
81 )
82 );
83
84 \TIOB\Main::instance();
85 }
86
87 function ti_tpc_activation_redirect( $product ) {
88 // If the installation time is not set, it means TPC is installed for the first time.
89 if ( empty( get_option( 'templates_patterns_collection_install' ) ) ) {
90 update_option( 'tpc_obd_new_user', 'yes' );
91 }
92 if ( ( current_action() === 'activated_plugin' && $product === TIOB_BASENAME ) || current_action() === 'switch_theme' ) {
93 add_option( 'tpc_maybe_run_onboarding', true );
94 }
95 }
96 add_action( 'activated_plugin', 'ti_tpc_activation_redirect' );
97 add_action( 'switch_theme', 'ti_tpc_activation_redirect' );
98