-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathastra-import-export.php
63 lines (51 loc) · 1.72 KB
/
astra-import-export.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* Plugin Name: Import / Export Customizer Settings
* Plugin URI: https://wpastra.com/
* Description: This plugin is an add-on for the Astra WordPress Theme. It will help in Import Export Customizer settings.
* Version: 1.1.0
* Author: Brainstorm Force
* Author URI: http://www.brainstormforce.com
* Text Domain: astra-import-export
*
* @package Import / Export Customizer Settings
*/
if ( 'astra' !== get_template() ) {
return;
}
/**
* Set constants.
*/
define( 'ASTRA_IMPORT_EXPORT_VER', '1.1.0' );
define( 'ASTRA_IMPORT_EXPORT_FILE', __FILE__ );
define( 'ASTRA_IMPORT_EXPORT_BASE', plugin_basename( ASTRA_IMPORT_EXPORT_FILE ) );
define( 'ASTRA_IMPORT_EXPORT_DIR', plugin_dir_path( ASTRA_IMPORT_EXPORT_FILE ) );
define( 'ASTRA_IMPORT_EXPORT_URI', plugins_url( '/', ASTRA_IMPORT_EXPORT_FILE ) );
/**
* Import / Export Customizer Settings Setup
*
* @since 1.0.0
*/
function astra_import_export_setup() {
require_once ASTRA_IMPORT_EXPORT_DIR . 'inc/class-astra-import-export.php';
}
add_action( 'plugins_loaded', 'astra_import_export_setup' );
/**
* Add plugin settings link.
*
* @param Array $links Plugin links to be displayed on the plugins.php.
* @return Array
*/
function aix_plugin_action_links( $links ) {
$page_slug = 'astra';
if ( is_callable( 'Astra_Admin_Settings::get_theme_page_slug' ) ) {
$page_slug = Astra_Admin_Settings::get_theme_page_slug();
}
$query_args = array(
'page' => $page_slug,
'path' => 'settings',
);
$links[] = '<a href="' . esc_url( add_query_arg( $query_args, get_admin_url( null, 'themes.php' ) ) ) . '">' . __( 'Settings', 'astra-import-export' ) . '</a>';
return $links;
}
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'aix_plugin_action_links' );