-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueryQuery.php
More file actions
57 lines (57 loc) · 1.95 KB
/
QueryQuery.php
File metadata and controls
57 lines (57 loc) · 1.95 KB
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
<?php
/*
Plugin Name: Query Query
Plugin URI: http://www.zamartz.com/Examples/queryquery
Description: Ability to make WP Queries within Posts and Pages through shortcode [QueryQuery]
Version: 1.0.0
Author: Zachary A. Martz
Author URI: http://www.zamartz.com
License: GPLv2 or later
Donate Link: http://bt.zamartz.com/RpKg9V
*/
// ==================================
// Start Admin Page
// ==================================
add_action('admin_menu', 'att_add_queryquery');
//Admin scripts
if (is_admin()){
add_action('admin_enqueue_scripts', 'my_QueryQuery_admin_theme');
//Uninstall script
register_uninstall_hook('uninstall.php',"");
//sets defaults on install
if (!get_option("QueryQuery_initialize")){
// get QueryQuery Admin Options
include_once('QueryQuery_options.php');
add_option( "QueryQuery_initialize",1,"","yes");
foreach ($option_list_names as $option_list_name){
$optionname = "QueryQuery_".$option_list_name["name"]."_default";
add_option($optionname,$option_list_name["default"],"","yes");
}
}
}
//Front end scrips
if (!is_admin()){
add_action('wp_enqueue_scripts', 'my_QueryQuery_front_theme');
}
//Make our function to call the WordPress function to add to the correct menu.
function att_add_queryquery() {
add_menu_page('Query Query', 'Query Query', 'administrator', 'menu-QueryQuery','add_queryquery_php',"div");
}
function my_QueryQuery_admin_theme() {
wp_enqueue_style('my-QueryQuery-admin-theme', plugins_url('QueryQuery.css', __FILE__));
}
function my_QueryQuery_front_theme() {
wp_enqueue_style('my-QueryQuery-front-defaut', plugins_url('QueryQuery_default.css', __FILE__));
}
function add_queryquery_php(){
require_once dirname( __FILE__ ) . '/QueryQuery_admin.php';
}
// ======================================
// Start Shortcodes
// ======================================
//check if admin
if (!is_admin()){
//check for active products
include_once dirname( __FILE__ ) . '/shortcodes.php';
}//end shortcodes
?>