Version Description
- Added: CPT-Food Menu Items
- Compatibility check up to version 4.9.4
- Update: Moved all plugin customizer options to new panel Essential Content Types Plugin Options
Download this release
Release Info
Developer | catchthemes |
Plugin | Essential Content Types |
Version | 1.0.9 |
Comparing to | |
See all releases |
Code changes from version 1.0.8 to 1.0.9
- README.txt +27 -1
- admin/class-essential-content-types-admin.php +10 -0
- admin/class-featured-content.php +8 -3
- admin/class-food-menu.php +1463 -0
- admin/class-portfolio.php +10 -4
- admin/class-service.php +9 -3
- admin/class-testimonial.php +6 -0
- admin/css/ect-food-menu-edit-items.css +24 -0
- admin/css/ect-food-menu-font.css +30 -0
- admin/css/ect-food-menu-many-items.css +14 -0
- admin/css/ect-food-menu.css +110 -0
- admin/css/food-menu-shortcode.css +137 -0
- admin/js/ect-food-menu-drag-drop.js +54 -0
- admin/js/ect-food-menu-many-items.js +112 -0
- admin/js/ect-food-menu-menu-checkboxes.js +51 -0
- admin/partials/dashboard-display.php +24 -0
- essential-content-types.php +1 -1
- includes/class-essential-content-types-activator.php +2 -1
- includes/class-essential-content-types.php +1 -1
- languages/essential-content-types.pot +394 -49
README.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: catchthemes, sakinshrestha, pratikshrestha, maheshmaharjan
|
|
3 |
Donate link: https://catchthemes.com/donate/
|
4 |
Tags: custom post types, CPT, CMS, post, types, post type, taxonomy, tax, custom, content types, post types, custom content types, testimonial, portfolio, featured content, service
|
5 |
Requires at least: 4.5
|
6 |
-
Tested up to: 4.9
|
7 |
Stable tag: trunk
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -142,6 +142,27 @@ Next, add the `[services]` shortcode to a post or page. The shortcode will displ
|
|
142 |
`
|
143 |
The example will display up to ten featured content in two columns, in ascending alphabetical order by project title. It will display Content Types, hide Content Tags, and only display projects that are assigned the “Grooming Tips” or “Best Kitties” Content Types.
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
== Installation ==
|
146 |
|
147 |
The easy way (via Dashboard) :
|
@@ -174,6 +195,11 @@ Not so easy way (via FTP) :
|
|
174 |
|
175 |
== Changelog ==
|
176 |
|
|
|
|
|
|
|
|
|
|
|
177 |
= 1.0.8 =
|
178 |
* Compatibility check up to version 4.9
|
179 |
|
3 |
Donate link: https://catchthemes.com/donate/
|
4 |
Tags: custom post types, CPT, CMS, post, types, post type, taxonomy, tax, custom, content types, post types, custom content types, testimonial, portfolio, featured content, service
|
5 |
Requires at least: 4.5
|
6 |
+
Tested up to: 4.9.4
|
7 |
Stable tag: trunk
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
142 |
`
|
143 |
The example will display up to ten featured content in two columns, in ascending alphabetical order by project title. It will display Content Types, hide Content Tags, and only display projects that are assigned the “Grooming Tips” or “Best Kitties” Content Types.
|
144 |
|
145 |
+
***Food Menu Shortcode***
|
146 |
+
|
147 |
+
You can use shortcodes to embed Food Menu on posts and pages.
|
148 |
+
Embedding Food Menu
|
149 |
+
|
150 |
+
**Embedding Food Menu**
|
151 |
+
|
152 |
+
To embed food menus on posts and pages, first activate the Food Menu custom content type on your site and add some food menus.
|
153 |
+
|
154 |
+
Next, add the `[food_menu]` shortcode to a post or page. The shortcode will display food menu in the selected post or page.
|
155 |
+
|
156 |
+
**Attributes**
|
157 |
+
* showposts: number of menu items to display. Defaults to all. (number)
|
158 |
+
* include_type: display specific Content Types. Defaults to all. (comma-separated list of Content Type slugs)
|
159 |
+
* include_tag: display specific Content Tags. Defaults to all. (comma-separated list of Content Tag slugs)
|
160 |
+
|
161 |
+
**Example**
|
162 |
+
|
163 |
+
`[food_menu showposts="10" include_type="pizza,burger,breakfast"]`
|
164 |
+
The example will display up to ten menu items. It will only display menu items in “Pizza”, “Burger” or “Breakfast” sections.
|
165 |
+
|
166 |
== Installation ==
|
167 |
|
168 |
The easy way (via Dashboard) :
|
195 |
|
196 |
== Changelog ==
|
197 |
|
198 |
+
= 1.0.9 =
|
199 |
+
* Added: CPT-Food Menu Items
|
200 |
+
* Compatibility check up to version 4.9.4
|
201 |
+
* Update: Moved all plugin customizer options to new panel Essential Content Types Plugin Options
|
202 |
+
|
203 |
= 1.0.8 =
|
204 |
* Compatibility check up to version 4.9
|
205 |
|
admin/class-essential-content-types-admin.php
CHANGED
@@ -106,6 +106,14 @@ class Essential_Content_Types_Admin {
|
|
106 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-service.php';
|
107 |
}
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
}
|
110 |
|
111 |
|
@@ -121,6 +129,7 @@ class Essential_Content_Types_Admin {
|
|
121 |
'essential-content-types_page_ect-testimonial' => 1,
|
122 |
'essential-content-types_page_ect-featured-content' => 1,
|
123 |
'essential-content-types_page_ect-service' => 1,
|
|
|
124 |
);
|
125 |
|
126 |
if ( ! isset( $allowed_pages[ $hook_suffix ] ) ){
|
@@ -143,6 +152,7 @@ class Essential_Content_Types_Admin {
|
|
143 |
'essential-content-types_page_ect-testimonial' => 1,
|
144 |
'essential-content-types_page_ect-featured-content' => 1,
|
145 |
'essential-content-types_page_ect-service' => 1,
|
|
|
146 |
);
|
147 |
|
148 |
if ( ! isset( $allowed_pages[ $hook_suffix ] ) ){
|
106 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-service.php';
|
107 |
}
|
108 |
|
109 |
+
$food_menu_options = get_option( 'ect_food_menu' );
|
110 |
+
if ( $food_menu_options['status'] ) {
|
111 |
+
/**
|
112 |
+
* Load Food Menu Type
|
113 |
+
*/
|
114 |
+
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-food-menu.php';
|
115 |
+
}
|
116 |
+
|
117 |
}
|
118 |
|
119 |
|
129 |
'essential-content-types_page_ect-testimonial' => 1,
|
130 |
'essential-content-types_page_ect-featured-content' => 1,
|
131 |
'essential-content-types_page_ect-service' => 1,
|
132 |
+
'essential-content-types_page_ect-food-menu' => 1,
|
133 |
);
|
134 |
|
135 |
if ( ! isset( $allowed_pages[ $hook_suffix ] ) ){
|
152 |
'essential-content-types_page_ect-testimonial' => 1,
|
153 |
'essential-content-types_page_ect-featured-content' => 1,
|
154 |
'essential-content-types_page_ect-service' => 1,
|
155 |
+
'essential-content-types_page_ect-food-menu' => 1,
|
156 |
);
|
157 |
|
158 |
if ( ! isset( $allowed_pages[ $hook_suffix ] ) ){
|
admin/class-featured-content.php
CHANGED
@@ -267,9 +267,14 @@ class Essential_Content_Featured_Content {
|
|
267 |
* Adds featured_content section to the Customizer.
|
268 |
*/
|
269 |
function customize_register( $wp_customize ) {
|
|
|
|
|
|
|
|
|
|
|
270 |
$wp_customize->add_section( 'ect_featured_content', array(
|
271 |
-
'title'
|
272 |
-
'
|
273 |
) );
|
274 |
|
275 |
$wp_customize->add_setting( 'featured_content_title', array(
|
@@ -710,4 +715,4 @@ class Essential_Content_Featured_Content {
|
|
710 |
}
|
711 |
}
|
712 |
}
|
713 |
-
add_action( 'init', array( 'Essential_Content_Featured_Content', 'init' ) );
|
267 |
* Adds featured_content section to the Customizer.
|
268 |
*/
|
269 |
function customize_register( $wp_customize ) {
|
270 |
+
$wp_customize->add_panel( 'ect_plugin_options', array(
|
271 |
+
'title' => esc_html__( 'Essential Content Types Plugin Options', 'essential-content-types' ),
|
272 |
+
'priority' => 1,
|
273 |
+
) );
|
274 |
+
|
275 |
$wp_customize->add_section( 'ect_featured_content', array(
|
276 |
+
'title' => esc_html__( 'Featured Content', 'essential-content-types' ),
|
277 |
+
'panel' => 'ect_plugin_options',
|
278 |
) );
|
279 |
|
280 |
$wp_customize->add_setting( 'featured_content_title', array(
|
715 |
}
|
716 |
}
|
717 |
}
|
718 |
+
add_action( 'init', array( 'Essential_Content_Featured_Content', 'init' ) );
|
admin/class-food-menu.php
ADDED
@@ -0,0 +1,1463 @@
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Put the following code in your theme's Food Menu Page Template to customize the markup of the menu.
|
4 |
+
|
5 |
+
if ( class_exists( 'Essential_Content_Food_Menu' ) ) {
|
6 |
+
Essential_Content_Food_Menu::init( array(
|
7 |
+
'menu_tag' => 'section',
|
8 |
+
'menu_class' => 'menu-items',
|
9 |
+
'menu_header_tag' => 'header',
|
10 |
+
'menu_header_class' => 'menu-group-header',
|
11 |
+
'menu_title_tag' => 'h1',
|
12 |
+
'menu_title_class' => 'menu-group-title',
|
13 |
+
'menu_description_tag' => 'div',
|
14 |
+
'menu_description_class' => 'menu-group-description',
|
15 |
+
) );
|
16 |
+
}
|
17 |
+
|
18 |
+
*/
|
19 |
+
|
20 |
+
/* @todo
|
21 |
+
|
22 |
+
Bulk/Quick edit response of Menu Item rows is broken.
|
23 |
+
|
24 |
+
Drag and Drop reordering.
|
25 |
+
*/
|
26 |
+
|
27 |
+
class Essential_Content_Food_Menu {
|
28 |
+
const MENU_ITEM_POST_TYPE = 'ect_food_menu_item';
|
29 |
+
const MENU_ITEM_LABEL_TAX = 'ect_food_menu_item_label';
|
30 |
+
const MENU_TAX = 'ect_food_menu';
|
31 |
+
|
32 |
+
public $version = '0.1';
|
33 |
+
|
34 |
+
protected $default_menu_item_loop_markup = array(
|
35 |
+
'menu_tag' => 'section',
|
36 |
+
'menu_class' => 'menu-items',
|
37 |
+
'menu_header_tag' => 'header',
|
38 |
+
'menu_header_class' => 'menu-group-header',
|
39 |
+
'menu_title_tag' => 'h1',
|
40 |
+
'menu_title_class' => 'menu-group-title',
|
41 |
+
'menu_description_tag' => 'div',
|
42 |
+
'menu_description_class' => 'menu-group-description',
|
43 |
+
);
|
44 |
+
|
45 |
+
protected $menu_item_loop_markup = array();
|
46 |
+
protected $menu_item_loop_last_term_id = false;
|
47 |
+
protected $menu_item_loop_current_term = false;
|
48 |
+
|
49 |
+
static function init( $menu_item_loop_markup = array() ) {
|
50 |
+
static $instance = false;
|
51 |
+
|
52 |
+
if ( !$instance ) {
|
53 |
+
$instance = new Essential_Content_Food_Menu;
|
54 |
+
}
|
55 |
+
|
56 |
+
if ( $menu_item_loop_markup ) {
|
57 |
+
$instance->menu_item_loop_markup = wp_parse_args( $menu_item_loop_markup, $instance->default_menu_item_loop_markup );
|
58 |
+
}
|
59 |
+
|
60 |
+
return $instance;
|
61 |
+
}
|
62 |
+
|
63 |
+
function __construct() {
|
64 |
+
if ( ! $this->site_supports_food_menu() )
|
65 |
+
return;
|
66 |
+
|
67 |
+
$this->register_taxonomies();
|
68 |
+
$this->register_post_types();
|
69 |
+
add_action( 'admin_menu', array( $this, 'add_admin_menus' ) );
|
70 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_ect_food_styles' ) );
|
71 |
+
add_action( 'admin_head', array( $this, 'set_custom_font_icon' ) );
|
72 |
+
|
73 |
+
// Enable Omnisearch for Menu Items.
|
74 |
+
if ( class_exists( 'Jetpack_Omnisearch_Posts' ) )
|
75 |
+
new Jetpack_Omnisearch_Posts( self::MENU_ITEM_POST_TYPE );
|
76 |
+
|
77 |
+
// Always sort menu items correctly
|
78 |
+
add_action( 'parse_query', array( $this, 'sort_menu_item_queries_by_menu_order' ) );
|
79 |
+
add_filter( 'posts_results', array( $this, 'sort_menu_item_queries_by_menu_taxonomy' ), 10, 2 );
|
80 |
+
|
81 |
+
add_action( 'wp_insert_post', array( $this, 'add_post_meta' ) );
|
82 |
+
|
83 |
+
$this->menu_item_loop_markup = $this->default_menu_item_loop_markup;
|
84 |
+
|
85 |
+
// Only output our Menu Item Loop Markup on a real blog view. Not feeds, XML-RPC, admin, etc.
|
86 |
+
add_filter( 'template_include', array( $this, 'setup_menu_item_loop_markup__in_filter' ) );
|
87 |
+
|
88 |
+
add_filter( 'enter_title_here', array( $this, 'change_default_title' ) );
|
89 |
+
add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
|
90 |
+
add_filter( 'dashboard_glance_items', array( $this, 'add_to_dashboard' ) );
|
91 |
+
|
92 |
+
add_filter( 'body_class', array( $this, 'custom_class' ) );
|
93 |
+
|
94 |
+
// register food_menu shortcode (legacy)
|
95 |
+
add_shortcode( 'food_menu', array( $this, 'ect_food_shortcode' ) );
|
96 |
+
}
|
97 |
+
|
98 |
+
public function custom_class( $classes ) {
|
99 |
+
global $post;
|
100 |
+
if( isset( $post->post_content ) && has_shortcode( $post->post_content, 'food_menu' ) ) {
|
101 |
+
$classes[] = 'page-template-menu-page';
|
102 |
+
}
|
103 |
+
return $classes;
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Should this Custom Post Type be made available?
|
108 |
+
*/
|
109 |
+
function site_supports_food_menu() {
|
110 |
+
// If we're on WordPress.com, and it has the menu site vertical.
|
111 |
+
if ( function_exists( 'site_vertical' ) && 'ect_food_menu' == site_vertical() )
|
112 |
+
return true;
|
113 |
+
|
114 |
+
// Else, if the current theme requests it.
|
115 |
+
if ( current_theme_supports( self::MENU_ITEM_POST_TYPE ) )
|
116 |
+
return true;
|
117 |
+
}
|
118 |
+
|
119 |
+
/* Setup */
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Register Taxonomies and Post Type
|
123 |
+
*/
|
124 |
+
function register_taxonomies() {
|
125 |
+
if ( ! taxonomy_exists( self::MENU_ITEM_LABEL_TAX ) ) {
|
126 |
+
register_taxonomy( self::MENU_ITEM_LABEL_TAX, self::MENU_ITEM_POST_TYPE, array(
|
127 |
+
'labels' => array(
|
128 |
+
/* translators: this is about a food menu */
|
129 |
+
'name' => __( 'Menu Item Labels', 'essential-content-types' ),
|
130 |
+
/* translators: this is about a food menu */
|
131 |
+
'singular_name' => __( 'Menu Item Label', 'essential-content-types' ),
|
132 |
+
/* translators: this is about a food menu */
|
133 |
+
'search_items' => __( 'Search Menu Item Labels', 'essential-content-types' ),
|
134 |
+
'popular_items' => __( 'Popular Labels', 'essential-content-types' ),
|
135 |
+
/* translators: this is about a food menu */
|
136 |
+
'all_items' => __( 'All Menu Item Labels', 'essential-content-types' ),
|
137 |
+
/* translators: this is about a food menu */
|
138 |
+
'edit_item' => __( 'Edit Menu Item Label', 'essential-content-types' ),
|
139 |
+
/* translators: this is about a food menu */
|
140 |
+
'view_item' => __( 'View Menu Item Label', 'essential-content-types' ),
|
141 |
+
/* translators: this is about a food menu */
|
142 |
+
'update_item' => __( 'Update Menu Item Label', 'essential-content-types' ),
|
143 |
+
/* translators: this is about a food menu */
|
144 |
+
'add_new_item' => __( 'Add New Menu Item Label', 'essential-content-types' ),
|
145 |
+
/* translators: this is about a food menu */
|
146 |
+
'new_item_name' => __( 'New Menu Item Label Name', 'essential-content-types' ),
|
147 |
+
'separate_items_with_commas' => __( 'For example, spicy, favorite, etc. <br /> Separate Labels with commas', 'essential-content-types' ),
|
148 |
+
'add_or_remove_items' => __( 'Add or remove Labels', 'essential-content-types' ),
|
149 |
+
'choose_from_most_used' => __( 'Choose from the most used Labels', 'essential-content-types' ),
|
150 |
+
'items_list_navigation' => __( 'Menu item label list navigation', 'essential-content-types' ),
|
151 |
+
'items_list' => __( 'Menu item labels list', 'essential-content-types' ),
|
152 |
+
),
|
153 |
+
'no_tagcloud' => __( 'No Labels found', 'essential-content-types' ),
|
154 |
+
'hierarchical' => false,
|
155 |
+
) );
|
156 |
+
}
|
157 |
+
|
158 |
+
if ( ! taxonomy_exists( self::MENU_TAX ) ) {
|
159 |
+
register_taxonomy( self::MENU_TAX, self::MENU_ITEM_POST_TYPE, array(
|
160 |
+
'labels' => array(
|
161 |
+
/* translators: this is about a food menu */
|
162 |
+
'name' => __( 'Menu Sections', 'essential-content-types' ),
|
163 |
+
/* translators: this is about a food menu */
|
164 |
+
'singular_name' => __( 'Menu Section', 'essential-content-types' ),
|
165 |
+
/* translators: this is about a food menu */
|
166 |
+
'search_items' => __( 'Search Menu Sections', 'essential-content-types' ),
|
167 |
+
/* translators: this is about a food menu */
|
168 |
+
'all_items' => __( 'All Menu Sections', 'essential-content-types' ),
|
169 |
+
/* translators: this is about a food menu */
|
170 |
+
'parent_item' => __( 'Parent Menu Section', 'essential-content-types' ),
|
171 |
+
/* translators: this is about a food menu */
|
172 |
+
'parent_item_colon' => __( 'Parent Menu Section:', 'essential-content-types' ),
|
173 |
+
/* translators: this is about a food menu */
|
174 |
+
'edit_item' => __( 'Edit Menu Section', 'essential-content-types' ),
|
175 |
+
/* translators: this is about a food menu */
|
176 |
+
'view_item' => __( 'View Menu Section', 'essential-content-types' ),
|
177 |
+
/* translators: this is about a food menu */
|
178 |
+
'update_item' => __( 'Update Menu Section', 'essential-content-types' ),
|
179 |
+
/* translators: this is about a food menu */
|
180 |
+
'add_new_item' => __( 'Add New Menu Section', 'essential-content-types' ),
|
181 |
+
/* translators: this is about a food menu */
|
182 |
+
'new_item_name' => __( 'New Menu Sections Name', 'essential-content-types' ),
|
183 |
+
'items_list_navigation' => __( 'Menu section list navigation', 'essential-content-types' ),
|
184 |
+
'items_list' => __( 'Menu section list', 'essential-content-types' ),
|
185 |
+
),
|
186 |
+
'rewrite' => array(
|
187 |
+
'slug' => 'menu',
|
188 |
+
'with_front' => false,
|
189 |
+
'hierarchical' => true,
|
190 |
+
),
|
191 |
+
'hierarchical' => true,
|
192 |
+
'show_tagcloud' => false,
|
193 |
+
'query_var' => 'menu',
|
194 |
+
) );
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
function register_post_types() {
|
199 |
+
if ( post_type_exists( self::MENU_ITEM_POST_TYPE ) ) {
|
200 |
+
return;
|
201 |
+
}
|
202 |
+
|
203 |
+
register_post_type( self::MENU_ITEM_POST_TYPE, array(
|
204 |
+
'description' => __( "Items on your restaurant's menu", 'essential-content-types' ),
|
205 |
+
|
206 |
+
'labels' => array(
|
207 |
+
/* translators: this is about a food menu */
|
208 |
+
'name' => __( 'Menu Items', 'essential-content-types' ),
|
209 |
+
/* translators: this is about a food menu */
|
210 |
+
'singular_name' => __( 'Menu Item', 'essential-content-types' ),
|
211 |
+
/* translators: this is about a food menu */
|
212 |
+
'menu_name' => __( 'Food Menus', 'essential-content-types' ),
|
213 |
+
/* translators: this is about a food menu */
|
214 |
+
'all_items' => __( 'Menu Items', 'essential-content-types' ),
|
215 |
+
/* translators: this is about a food menu */
|
216 |
+
'add_new' => __( 'Add One Item', 'essential-content-types' ),
|
217 |
+
/* translators: this is about a food menu */
|
218 |
+
'add_new_item' => __( 'Add Menu Item', 'essential-content-types' ),
|
219 |
+
/* translators: this is about a food menu */
|
220 |
+
'edit_item' => __( 'Edit Menu Item', 'essential-content-types' ),
|
221 |
+
/* translators: this is about a food menu */
|
222 |
+
'new_item' => __( 'New Menu Item', 'essential-content-types' ),
|
223 |
+
/* translators: this is about a food menu */
|
224 |
+
'view_item' => __( 'View Menu Item', 'essential-content-types' ),
|
225 |
+
/* translators: this is about a food menu */
|
226 |
+
'search_items' => __( 'Search Menu Items', 'essential-content-types' ),
|
227 |
+
/* translators: this is about a food menu */
|
228 |
+
'not_found' => __( 'No Menu Items found', 'essential-content-types' ),
|
229 |
+
/* translators: this is about a food menu */
|
230 |
+
'not_found_in_trash' => __( 'No Menu Items found in Trash', 'essential-content-types' ),
|
231 |
+
'filter_items_list' => __( 'Filter menu items list', 'essential-content-types' ),
|
232 |
+
'items_list_navigation' => __( 'Menu item list navigation', 'essential-content-types' ),
|
233 |
+
'items_list' => __( 'Menu items list', 'essential-content-types' ),
|
234 |
+
),
|
235 |
+
'supports' => array(
|
236 |
+
'title',
|
237 |
+
'editor',
|
238 |
+
'excerpt',
|
239 |
+
),
|
240 |
+
'rewrite' => array(
|
241 |
+
'slug' => 'item',
|
242 |
+
'with_front' => false,
|
243 |
+
'feeds' => false,
|
244 |
+
'pages' => false,
|
245 |
+
),
|
246 |
+
'register_meta_box_cb' => array( $this, 'register_menu_item_meta_boxes' ),
|
247 |
+
|
248 |
+
'public' => true,
|
249 |
+
'show_ui' => true, // set to false to replace with custom UI
|
250 |
+
'menu_position' => 20, // below Pages
|
251 |
+
'capability_type' => 'page',
|
252 |
+
'map_meta_cap' => true,
|
253 |
+
'has_archive' => false,
|
254 |
+
'query_var' => 'item',
|
255 |
+
) );
|
256 |
+
}
|
257 |
+
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Update messages for the Menu Item admin.
|
261 |
+
*/
|
262 |
+
function updated_messages( $messages ) {
|
263 |
+
global $post;
|
264 |
+
|
265 |
+
$messages[self::MENU_ITEM_POST_TYPE] = array(
|
266 |
+
0 => '', // Unused. Messages start at index 1.
|
267 |
+
/* translators: this is about a food menu */
|
268 |
+
1 => sprintf( __( 'Menu item updated. <a href="%s">View item</a>', 'essential-content-types' ), esc_url( get_permalink( $post->ID ) ) ),
|
269 |
+
2 => esc_html__( 'Custom field updated.', 'essential-content-types' ),
|
270 |
+
3 => esc_html__( 'Custom field deleted.', 'essential-content-types' ),
|
271 |
+
/* translators: this is about a food menu */
|
272 |
+
4 => esc_html__( 'Menu item updated.', 'essential-content-types' ),
|
273 |
+
/* translators: %s: date and time of the revision */
|
274 |
+
5 => isset( $_GET['revision'] ) ? sprintf( esc_html__( 'Menu item restored to revision from %s', 'essential-content-types' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
275 |
+
/* translators: this is about a food menu */
|
276 |
+
6 => sprintf( __( 'Menu item published. <a href="%s">View item</a>', 'essential-content-types' ), esc_url( get_permalink( $post->ID ) ) ),
|
277 |
+
/* translators: this is about a food menu */
|
278 |
+
7 => esc_html__( 'Menu item saved.', 'essential-content-types' ),
|
279 |
+
/* translators: this is about a food menu */
|
280 |
+
8 => sprintf( __( 'Menu item submitted. <a target="_blank" href="%s">Preview item</a>', 'essential-content-types' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ),
|
281 |
+
/* translators: this is about a food menu */
|
282 |
+
9 => sprintf( __( 'Menu item scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview item</a>', 'essential-content-types' ),
|
283 |
+
// translators: Publish box date format, see http://php.net/date
|
284 |
+
date_i18n( __( 'M j, Y @ G:i', 'essential-content-types' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post->ID) ) ),
|
285 |
+
/* translators: this is about a food menu */
|
286 |
+
10 => sprintf( __( 'Menu item draft updated. <a target="_blank" href="%s">Preview item</a>', 'essential-content-types' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ),
|
287 |
+
);
|
288 |
+
|
289 |
+
return $messages;
|
290 |
+
}
|
291 |
+
|
292 |
+
|
293 |
+
/**
|
294 |
+
* Nova Styles and Scripts
|
295 |
+
*/
|
296 |
+
function enqueue_ect_food_styles( $hook ) {
|
297 |
+
global $post_type;
|
298 |
+
$pages = array( 'edit.php', 'post.php', 'post-new.php' );
|
299 |
+
|
300 |
+
if ( in_array( $hook, $pages ) && $post_type == self::MENU_ITEM_POST_TYPE ) {
|
301 |
+
wp_enqueue_style( 'ect-food-menu-style', plugins_url( 'css/ect-food-menu.css', __FILE__ ), array(), $this->version );
|
302 |
+
}
|
303 |
+
|
304 |
+
wp_enqueue_style( 'ect-food-menu-font', plugins_url( 'css/ect-food-menu-font.css', __FILE__ ), array(), $this->version );
|
305 |
+
}
|
306 |
+
|
307 |
+
|
308 |
+
/**
|
309 |
+
* Change ‘Enter Title Here’ text for the Menu Item.
|
310 |
+
*/
|
311 |
+
function change_default_title( $title ) {
|
312 |
+
$screen = get_current_screen();
|
313 |
+
|
314 |
+
if ( self::MENU_ITEM_POST_TYPE == $screen->post_type )
|
315 |
+
/* translators: this is about a food menu */
|
316 |
+
$title = esc_html__( "Enter the menu item's name here", 'essential-content-types' );
|
317 |
+
|
318 |
+
return $title;
|
319 |
+
}
|
320 |
+
|
321 |
+
|
322 |
+
/**
|
323 |
+
* Add to Dashboard At A Glance
|
324 |
+
*/
|
325 |
+
function add_to_dashboard() {
|
326 |
+
$number_menu_items = wp_count_posts( self::MENU_ITEM_POST_TYPE );
|
327 |
+
|
328 |
+
if ( current_user_can( 'administrator' ) ) {
|
329 |
+
$number_menu_items_published = sprintf( '<a href="%1$s">%2$s</a>',
|
330 |
+
esc_url( get_admin_url( get_current_blog_id(), 'edit.php?post_type=' . self::MENU_ITEM_POST_TYPE ) ),
|
331 |
+
sprintf( _n( '%1$d Food Menu Item', '%1$d Food Menu Items', intval( $number_menu_items->publish ), 'essential-content-types' ), number_format_i18n( $number_menu_items->publish ) )
|
332 |
+
);
|
333 |
+
}
|
334 |
+
else {
|
335 |
+
$number_menu_items_published = sprintf( '<span>%1$s</span>',
|
336 |
+
sprintf( _n( '%1$d Food Menu Item', '%1$d Food Menu Items', intval( $number_menu_items->publish ), 'essential-content-types' ), number_format_i18n( $number_menu_items->publish ) )
|
337 |
+
);
|
338 |
+
}
|
339 |
+
|
340 |
+
echo '<li class="ect-food-menu-count">' . $number_menu_items_published . '</li>';
|
341 |
+
}
|
342 |
+
|
343 |
+
|
344 |
+
/**
|
345 |
+
* Query
|
346 |
+
*/
|
347 |
+
function is_menu_item_query( $query ) {
|
348 |
+
if (
|
349 |
+
( isset( $query->query_vars['taxonomy'] ) && self::MENU_TAX == $query->query_vars['taxonomy'] )
|
350 |
+
||
|
351 |
+
( isset( $query->query_vars['post_type'] ) && self::MENU_ITEM_POST_TYPE == $query->query_vars['post_type'] )
|
352 |
+
) {
|
353 |
+
return true;
|
354 |
+
}
|
355 |
+
|
356 |
+
return false;
|
357 |
+
}
|
358 |
+
|
359 |
+
function sort_menu_item_queries_by_menu_order( $query ) {
|
360 |
+
if ( ! $this->is_menu_item_query( $query ) ) {
|
361 |
+
return;
|
362 |
+
}
|
363 |
+
|
364 |
+
$query->query_vars['orderby'] = 'menu_order';
|
365 |
+
$query->query_vars['order'] = 'ASC';
|
366 |
+
|
367 |
+
// For now, just turn off paging so we can sort by taxonmy later
|
368 |
+
// If we want paging in the future, we'll need to add the taxonomy sort here (or at least before the DB query is made)
|
369 |
+
$query->query_vars['posts_per_page'] = -1;
|
370 |
+
}
|
371 |
+
|
372 |
+
function sort_menu_item_queries_by_menu_taxonomy( $posts, $query ) {
|
373 |
+
if ( !$posts ) {
|
374 |
+
return $posts;
|
375 |
+
}
|
376 |
+
|
377 |
+
if ( !$this->is_menu_item_query( $query ) ) {
|
378 |
+
return $posts;
|
379 |
+
}
|
380 |
+
|
381 |
+
$grouped_by_term = array();
|
382 |
+
|
383 |
+
foreach ( $posts as $post ) {
|
384 |
+
$term = $this->get_menu_item_menu_leaf( $post->ID );
|
385 |
+
if ( !$term || is_wp_error( $term ) ) {
|
386 |
+
$term_id = 0;
|
387 |
+
} else {
|
388 |
+
$term_id = $term->term_id;
|
389 |
+
}
|
390 |
+
|
391 |
+
if ( !isset( $grouped_by_term["$term_id"] ) ) {
|
392 |
+
$grouped_by_term["$term_id"] = array();
|
393 |
+
}
|
394 |
+
|
395 |
+
$grouped_by_term["$term_id"][] = $post;
|
396 |
+
}
|
397 |
+
|
398 |
+
$term_order = get_option( 'ect_food_menu_order', array() );
|
399 |
+
|
400 |
+
$return = array();
|
401 |
+
foreach ( $term_order as $term_id ) {
|
402 |
+
if ( isset( $grouped_by_term["$term_id"] ) ) {
|
403 |
+
$return = array_merge( $return, $grouped_by_term["$term_id"] );
|
404 |
+
unset( $grouped_by_term["$term_id"] );
|
405 |
+
}
|
406 |
+
}
|
407 |
+
|
408 |
+
foreach ( $grouped_by_term as $term_id => $posts ) {
|
409 |
+
$return = array_merge( $return, $posts );
|
410 |
+
}
|
411 |
+
|
412 |
+
return $return;
|
413 |
+
}
|
414 |
+
|
415 |
+
|
416 |
+
/**
|
417 |
+
* Add Many Items
|
418 |
+
*/
|
419 |
+
function add_admin_menus() {
|
420 |
+
$hook = add_submenu_page(
|
421 |
+
'edit.php?post_type=' . self::MENU_ITEM_POST_TYPE,
|
422 |
+
__( 'Add Many Items', 'essential-content-types' ),
|
423 |
+
__( 'Add Many Items', 'essential-content-types' ),
|
424 |
+
'edit_pages',
|
425 |
+
'add_many_ect_food_items',
|
426 |
+
array( $this, 'add_many_new_items_page' )
|
427 |
+
);
|
428 |
+
|
429 |
+
add_action( "load-$hook", array( $this, 'add_many_new_items_page_load' ) );
|
430 |
+
|
431 |
+
add_action( 'current_screen', array( $this, 'current_screen_load' ) );
|
432 |
+
|
433 |
+
//Adjust 'Add Many Items' submenu position
|
434 |
+
if ( isset( $GLOBALS['submenu']['edit.php?post_type=' . self::MENU_ITEM_POST_TYPE] ) ) {
|
435 |
+
$submenu_item = array_pop( $GLOBALS['submenu']['edit.php?post_type=' . self::MENU_ITEM_POST_TYPE] );
|
436 |
+
$GLOBALS['submenu']['edit.php?post_type=' . self::MENU_ITEM_POST_TYPE][11] = $submenu_item;
|
437 |
+
ksort( $GLOBALS['submenu']['edit.php?post_type=' . self::MENU_ITEM_POST_TYPE] );
|
438 |
+
}
|
439 |
+
|
440 |
+
|
441 |
+
$this->setup_menu_item_columns();
|
442 |
+
|
443 |
+
wp_register_script(
|
444 |
+
'ect-food-menu-checkboxes',
|
445 |
+
plugin_dir_url( __FILE__ ) . 'js/ect-food-menu-menu-checkboxes.js',
|
446 |
+
array( 'jquery' ),
|
447 |
+
$this->version,
|
448 |
+
false
|
449 |
+
);
|
450 |
+
}
|
451 |
+
|
452 |
+
|
453 |
+
/**
|
454 |
+
* Custom Nova Icon CSS
|
455 |
+
*/
|
456 |
+
function set_custom_font_icon() {
|
457 |
+
?>
|
458 |
+
<style type="text/css">
|
459 |
+
#menu-posts-ect_food_menu_item .wp-menu-image:before {
|
460 |
+
font-family: 'nova-font' !important;
|
461 |
+
content: '\e603' !important;
|
462 |
+
}
|
463 |
+
</style>
|
464 |
+
<?php
|
465 |
+
}
|
466 |
+
|
467 |
+
function current_screen_load() {
|
468 |
+
$screen = get_current_screen();
|
469 |
+
if ( 'edit-ect_food_menu_item' !== $screen->id ) {
|
470 |
+
return;
|
471 |
+
}
|
472 |
+
|
473 |
+
$this->edit_menu_items_page_load();
|
474 |
+
add_filter( 'admin_notices', array( $this, 'admin_notices' ) );
|
475 |
+
}
|
476 |
+
|
477 |
+
/* Edit Items List */
|
478 |
+
|
479 |
+
function admin_notices() {
|
480 |
+
if ( isset( $_GET['ect_food_reordered'] ) )
|
481 |
+
/* translators: this is about a food menu */
|
482 |
+
printf( '<div class="updated"><p>%s</p></div>', __( 'Menu Items re-ordered.', 'essential-content-types' ) );
|
483 |
+
}
|
484 |
+
|
485 |
+
function no_title_sorting( $columns ) {
|
486 |
+
if ( isset( $columns['title'] ) )
|
487 |
+
unset( $columns['title'] );
|
488 |
+
return $columns;
|
489 |
+
}
|
490 |
+
|
491 |
+
function setup_menu_item_columns() {
|
492 |
+
add_filter( sprintf( 'manage_edit-%s_sortable_columns', self::MENU_ITEM_POST_TYPE ), array( $this, 'no_title_sorting' ) );
|
493 |
+
add_filter( sprintf( 'manage_%s_posts_columns', self::MENU_ITEM_POST_TYPE ), array( $this, 'menu_item_columns' ) );
|
494 |
+
|
495 |
+
add_action( sprintf( 'manage_%s_posts_custom_column', self::MENU_ITEM_POST_TYPE ), array( $this, 'menu_item_column_callback' ), 10, 2 );
|
496 |
+
}
|
497 |
+
|
498 |
+
function menu_item_columns( $columns ) {
|
499 |
+
unset( $columns['date'], $columns['likes'] );
|
500 |
+
|
501 |
+
$columns['thumbnail'] = __( 'Thumbnail', 'essential-content-types' );
|
502 |
+
$columns['labels'] = __( 'Labels', 'essential-content-types' );
|
503 |
+
$columns['price'] = __( 'Price', 'essential-content-types' );
|
504 |
+
$columns['order'] = __( 'Order', 'essential-content-types' );
|
505 |
+
|
506 |
+
return $columns;
|
507 |
+
}
|
508 |
+
|
509 |
+
function menu_item_column_callback( $column, $post_id ) {
|
510 |
+
$screen = get_current_screen();
|
511 |
+
|
512 |
+
switch ( $column ) {
|
513 |
+
case 'thumbnail':
|
514 |
+
echo get_the_post_thumbnail( $post_id, array( 50, 50 ) );
|
515 |
+
break;
|
516 |
+
case 'labels' :
|
517 |
+
$this->list_admin_labels( $post_id );
|
518 |
+
break;
|
519 |
+
case 'price' :
|
520 |
+
$this->display_price( $post_id );
|
521 |
+
break;
|
522 |
+
case 'order' :
|
523 |
+
$url = admin_url( $screen->parent_file );
|
524 |
+
|
525 |
+
$up_url = add_query_arg( array(
|
526 |
+
'action' => 'move-item-up',
|
527 |
+
'post_id' => (int) $post_id,
|
528 |
+
), wp_nonce_url( $url, 'ect_food_move_item_up_' . $post_id ) );
|
529 |
+
|
530 |
+
$down_url = add_query_arg( array(
|
531 |
+
'action' => 'move-item-down',
|
532 |
+
'post_id' => (int) $post_id,
|
533 |
+
), wp_nonce_url( $url, 'ect_food_move_item_down_' . $post_id ) );
|
534 |
+
$menu_item = get_post($post_id);
|
535 |
+
$this->get_menu_by_post_id( $post_id );
|
536 |
+
if ( $term_id = $this->get_menu_by_post_id( $post_id ) ) {
|
537 |
+
$term_id = $term_id->term_id;
|
538 |
+
}
|
539 |
+
?>
|
540 |
+
<input type="hidden" class="menu-order-value" name="ect_food_order[<?php echo (int) $post_id ?>]" value="<?php echo esc_attr( $menu_item->menu_order ) ?>" />
|
541 |
+
<input type="hidden" class='ect-food-menu-term' name="ect_food_menu_term[<?php echo (int) $post_id ?>]" value="<?php echo esc_attr( $term_id ); ?>">
|
542 |
+
|
543 |
+
<span class="hide-if-js">
|
544 |
+
— <a class="ect-food-move-item-up" data-post-id="<?php echo (int) $post_id; ?>" href="<?php echo esc_url( $up_url ); ?>">up</a>
|
545 |
+
<br />
|
546 |
+
— <a class="ect-food-move-item-down" data-post-id="<?php echo (int) $post_id; ?>" href="<?php echo esc_url( $down_url ); ?>">down</a>
|
547 |
+
</span>
|
548 |
+
<?php
|
549 |
+
break;
|
550 |
+
}
|
551 |
+
}
|
552 |
+
|
553 |
+
function get_menu_by_post_id( $post_id = null ) {
|
554 |
+
if ( ! $post_id )
|
555 |
+
return false;
|
556 |
+
|
557 |
+
$terms = get_the_terms( $post_id, self::MENU_TAX );
|
558 |
+
|
559 |
+
if ( ! is_array( $terms ) )
|
560 |
+
return false;
|
561 |
+
|
562 |
+
return array_pop( $terms );
|
563 |
+
}
|
564 |
+
|
565 |
+
/**
|
566 |
+
* Fires on a menu edit page. We might have drag-n-drop reordered
|
567 |
+
*/
|
568 |
+
function maybe_reorder_menu_items() {
|
569 |
+
// make sure we clicked our button
|
570 |
+
if ( ! ( isset( $_REQUEST['menu_reorder_submit'] ) && $_REQUEST['menu_reorder_submit'] === __( 'Save New Order', 'essential-content-types' ) ) )
|
571 |
+
return;
|
572 |
+
;
|
573 |
+
|
574 |
+
// make sure we have the nonce
|
575 |
+
if ( ! ( isset( $_REQUEST['drag-drop-reorder'] ) && wp_verify_nonce( $_REQUEST['drag-drop-reorder'], 'drag-drop-reorder' ) ) )
|
576 |
+
return;
|
577 |
+
|
578 |
+
$term_pairs = array_map( 'absint', $_REQUEST['ect_food_menu_term'] );
|
579 |
+
$order_pairs = array_map( 'absint', $_REQUEST['ect_food_order'] );
|
580 |
+
|
581 |
+
foreach( $order_pairs as $ID => $menu_order ) {
|
582 |
+
$ID = absint( $ID );
|
583 |
+
unset( $order_pairs[$ID] );
|
584 |
+
if ( $ID < 0 )
|
585 |
+
continue;
|
586 |
+
|
587 |
+
$post = get_post( $ID );
|
588 |
+
if ( ! $post )
|
589 |
+
continue;
|
590 |
+
|
591 |
+
// save a write if the order hasn't changed
|
592 |
+
if ( $menu_order != $post->menu_order )
|
593 |
+
wp_update_post( compact( 'ID', 'menu_order' ) );
|
594 |
+
|
595 |
+
// save a write if the term hasn't changed
|
596 |
+
if ( $term_pairs[$ID] != $this->get_menu_by_post_id( $ID )->term_id )
|
597 |
+
wp_set_object_terms( $ID, $term_pairs[$ID], self::MENU_TAX );
|
598 |
+
|
599 |
+
}
|
600 |
+
|
601 |
+
$redirect = add_query_arg( array(
|
602 |
+
'post_type' => self::MENU_ITEM_POST_TYPE,
|
603 |
+
'ect_food_reordered' => '1'
|
604 |
+
), admin_url( 'edit.php' ) );
|
605 |
+
wp_safe_redirect( $redirect );
|
606 |
+
exit;
|
607 |
+
|
608 |
+
}
|
609 |
+
|
610 |
+
function edit_menu_items_page_load() {
|
611 |
+
if ( isset( $_GET['action'] ) ) {
|
612 |
+
$this->handle_menu_item_actions();
|
613 |
+
}
|
614 |
+
|
615 |
+
$this->maybe_reorder_menu_items();
|
616 |
+
|
617 |
+
wp_enqueue_script(
|
618 |
+
'ect-food-drag-drop',
|
619 |
+
plugin_dir_url( __FILE__ ) . 'js/ect-food-menu-drag-drop.js',
|
620 |
+
array( 'jquery-ui-sortable' ),
|
621 |
+
$this->version,
|
622 |
+
true
|
623 |
+
);
|
624 |
+
|
625 |
+
wp_localize_script( 'ect-food-drag-drop', '_novaDragDrop', array(
|
626 |
+
'nonce' => wp_create_nonce( 'drag-drop-reorder' ),
|
627 |
+
'nonceName' => 'drag-drop-reorder',
|
628 |
+
'reorder' => __( 'Save New Order', 'essential-content-types' ),
|
629 |
+
'reorderName' => 'menu_reorder_submit'
|
630 |
+
) );
|
631 |
+
add_action( 'the_post', array( $this, 'show_menu_titles_in_menu_item_list' ) );
|
632 |
+
}
|
633 |
+
|
634 |
+
function handle_menu_item_actions() {
|
635 |
+
$action = (string) $_GET['action'];
|
636 |
+
|
637 |
+
switch ( $action ) {
|
638 |
+
case 'move-item-up' :
|
639 |
+
case 'move-item-down' :
|
640 |
+
$reorder = false;
|
641 |
+
|
642 |
+
$post_id = (int) $_GET['post_id'];
|
643 |
+
|
644 |
+
$term = $this->get_menu_item_menu_leaf( $post_id );
|
645 |
+
|
646 |
+
// Get all posts in that term
|
647 |
+
$query = new WP_Query( array(
|
648 |
+
'taxonomy' => self::MENU_TAX,
|
649 |
+
'term' => $term->slug,
|
650 |
+
) );
|
651 |
+
|
652 |
+
$order = array();
|
653 |
+
foreach ( $query->posts as $post ) {
|
654 |
+
$order[] = $post->ID;
|
655 |
+
}
|
656 |
+
|
657 |
+
if ( 'move-item-up' == $action ) {
|
658 |
+
check_admin_referer( 'ect_food_move_item_up_' . $post_id );
|
659 |
+
|
660 |
+
$first_post_id = $order[0];
|
661 |
+
if ( $post_id == $first_post_id ) {
|
662 |
+
break;
|
663 |
+
}
|
664 |
+
|
665 |
+
foreach ( $order as $menu_order => $order_post_id ) {
|
666 |
+
if ( $post_id != $order_post_id ) {
|
667 |
+
continue;
|
668 |
+
}
|
669 |
+
|
670 |
+
$swap_post_id = $order[$menu_order - 1];
|
671 |
+
$order[$menu_order - 1] = $post_id;
|
672 |
+
$order[$menu_order] = $swap_post_id;
|
673 |
+
|
674 |
+
$reorder = true;
|
675 |
+
break;
|
676 |
+
}
|
677 |
+
} else {
|
678 |
+
check_admin_referer( 'ect_food_move_item_down_' . $post_id );
|
679 |
+
|
680 |
+
$last_post_id = end( $order );
|
681 |
+
if ( $post_id == $last_post_id ) {
|
682 |
+
break;
|
683 |
+
}
|
684 |
+
|
685 |
+
foreach ( $order as $menu_order => $order_post_id ) {
|
686 |
+
if ( $post_id != $order_post_id ) {
|
687 |
+
continue;
|
688 |
+
}
|
689 |
+
|
690 |
+
$swap_post_id = $order[$menu_order + 1];
|
691 |
+
$order[$menu_order + 1] = $post_id;
|
692 |
+
$order[$menu_order] = $swap_post_id;
|
693 |
+
|
694 |
+
$reorder = true;
|
695 |
+
}
|
696 |
+
}
|
697 |
+
|
698 |
+
if ( $reorder ) {
|
699 |
+
foreach ( $order as $menu_order => $ID ) {
|
700 |
+
wp_update_post( compact( 'ID', 'menu_order' ) );
|
701 |
+
}
|
702 |
+
}
|
703 |
+
|
704 |
+
break;
|
705 |
+
case 'move-menu-up' :
|
706 |
+
case 'move-menu-down' :
|
707 |
+
$reorder = false;
|
708 |
+
|
709 |
+
$term_id = (int) $_GET['term_id'];
|
710 |
+
|
711 |
+
$terms = $this->get_menus();
|
712 |
+
|
713 |
+
$order = array();
|
714 |
+
foreach ( $terms as $term ) {
|
715 |
+
$order[] = $term->term_id;
|
716 |
+
}
|
717 |
+
|
718 |
+
if ( 'move-menu-up' == $action ) {
|
719 |
+
check_admin_referer( 'ect_food_move_menu_up_' . $term_id );
|
720 |
+
|
721 |
+
$first_term_id = $order[0];
|
722 |
+
if ( $term_id == $first_term_id ) {
|
723 |
+
break;
|
724 |
+
}
|
725 |
+
|
726 |
+
foreach ( $order as $menu_order => $order_term_id ) {
|
727 |
+
if ( $term_id != $order_term_id ) {
|
728 |
+
continue;
|
729 |
+
}
|
730 |
+
|
731 |
+
$swap_term_id = $order[$menu_order - 1];
|
732 |
+
$order[$menu_order - 1] = $term_id;
|
733 |
+
$order[$menu_order] = $swap_term_id;
|
734 |
+
|
735 |
+
$reorder = true;
|
736 |
+
break;
|
737 |
+
}
|
738 |
+
} else {
|
739 |
+
check_admin_referer( 'ect_food_move_menu_down_' . $term_id );
|
740 |
+
|
741 |
+
$last_term_id = end( $order );
|
742 |
+
if ( $term_id == $last_term_id ) {
|
743 |
+
break;
|
744 |
+
}
|
745 |
+
|
746 |
+
foreach ( $order as $menu_order => $order_term_id ) {
|
747 |
+
if ( $term_id != $order_term_id ) {
|
748 |
+
continue;
|
749 |
+
}
|
750 |
+
|
751 |
+
$swap_term_id = $order[$menu_order + 1];
|
752 |
+
$order[$menu_order + 1] = $term_id;
|
753 |
+
$order[$menu_order] = $swap_term_id;
|
754 |
+
|
755 |
+
$reorder = true;
|
756 |
+
}
|
757 |
+
}
|
758 |
+
|
759 |
+
if ( $reorder ) {
|
760 |
+
update_option( 'ect_food_menu_order', $order );
|
761 |
+
}
|
762 |
+
|
763 |
+
break;
|
764 |
+
default :
|
765 |
+
return;
|
766 |
+
}
|
767 |
+
|
768 |
+
$redirect = add_query_arg( array(
|
769 |
+
'post_type' => self::MENU_ITEM_POST_TYPE,
|
770 |
+
'ect_food_reordered' => '1'
|
771 |
+
), admin_url( 'edit.php' ) );
|
772 |
+
wp_safe_redirect( $redirect );
|
773 |
+
exit;
|
774 |
+
}
|
775 |
+
|
776 |
+
/*
|
777 |
+
* Add menu title rows to the list table
|
778 |
+
*/
|
779 |
+
function show_menu_titles_in_menu_item_list( $post ) {
|
780 |
+
global $wp_list_table;
|
781 |
+
|
782 |
+
static $last_term_id = false;
|
783 |
+
|
784 |
+
$term = $this->get_menu_item_menu_leaf( $post->ID );
|
785 |
+
|
786 |
+
$term_id = $term instanceof WP_Term ? $term->term_id : null;
|
787 |
+
|
788 |
+
if ( false !== $last_term_id && $last_term_id === $term_id ) {
|
789 |
+
return;
|
790 |
+
}
|
791 |
+
|
792 |
+
if ( is_null( $term_id ) ) {
|
793 |
+
$last_term_id = null;
|
794 |
+
$term_name = '';
|
795 |
+
$parent_count = 0;
|
796 |
+
} else {
|
797 |
+
$last_term_id = $term->term_id;
|
798 |
+
$term_name = $term->name;
|
799 |
+
$parent_count = 0;
|
800 |
+
$current_term = $term;
|
801 |
+
while ( $current_term->parent ) {
|
802 |
+
$parent_count++;
|
803 |
+
$current_term = get_term( $current_term->parent, self::MENU_TAX );
|
804 |
+
}
|
805 |
+
}
|
806 |
+
|
807 |
+
$non_order_column_count = $wp_list_table->get_column_count() - 1;
|
808 |
+
|
809 |
+
$screen = get_current_screen();
|
810 |
+
|
811 |
+
$url = admin_url( $screen->parent_file );
|
812 |
+
|
813 |
+
$up_url = add_query_arg( array(
|
814 |
+
'action' => 'move-menu-up',
|
815 |
+
'term_id' => (int) $term_id,
|
816 |
+
), wp_nonce_url( $url, 'ect_food_move_menu_up_' . $term_id ) );
|
817 |
+
|
818 |
+
$down_url = add_query_arg( array(
|
819 |
+
'action' => 'move-menu-down',
|
820 |
+
'term_id' => (int) $term_id,
|
821 |
+
), wp_nonce_url( $url, 'ect_food_move_menu_down_' . $term_id ) );
|
822 |
+
|
823 |
+
?>
|
824 |
+
<tr class="no-items menu-label-row" data-term_id="<?php echo esc_attr( $term_id ) ?>">
|
825 |
+
<td class="colspanchange" colspan="<?php echo (int) $non_order_column_count; ?>">
|
826 |
+
<h3><?php
|
827 |
+
echo str_repeat( ' — ', (int) $parent_count );
|
828 |
+
|
829 |
+
if ( $term instanceof WP_Term ) {
|
830 |
+
echo esc_html( sanitize_term_field( 'name', $term_name, $term_id, self::MENU_TAX, 'display' ) );
|
831 |
+
edit_term_link( __( 'edit', 'essential-content-types' ), '<span class="edit-ect-food-section"><span class="dashicon dashicon-edit"></span>', '</span>', $term );
|
832 |
+
|
833 |
+
} else {
|
834 |
+
_e( 'Uncategorized' , 'essential-content-types' );
|
835 |
+
}
|
836 |
+
?></h3>
|
837 |
+
</td>
|
838 |
+
<td>
|
839 |
+
<?php if ( $term instanceof WP_Term ) { ?>
|
840 |
+
<a class="ect-food-move-menu-up" title="<?php esc_attr_e( 'Move menu section up', 'essential-content-types' ); ?>" href="<?php echo esc_url( $up_url ); ?>"><?php esc_html_e( 'UP', 'essential-content-types' ); ?></a>
|
841 |
+
<br />
|
842 |
+
<a class="ect-food-move-menu-down" title="<?php esc_attr_e( 'Move menu section down', 'essential-content-types' ); ?>" href="<?php echo esc_url( $down_url ); ?>"><?php esc_html_e( 'DOWN', 'essential-content-types' ); ?></a>
|
843 |
+
<?php } ?>
|
844 |
+
</td>
|
845 |
+
</tr>
|
846 |
+
<?php
|
847 |
+
}
|
848 |
+
|
849 |
+
/* Edit Many Items */
|
850 |
+
|
851 |
+
function add_many_new_items_page_load() {
|
852 |
+
if ( 'POST' === strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
|
853 |
+
$this->process_form_request();
|
854 |
+
exit;
|
855 |
+
}
|
856 |
+
|
857 |
+
$this->enqueue_many_items_scripts();
|
858 |
+
}
|
859 |
+
|
860 |
+
function enqueue_many_items_scripts() {
|
861 |
+
wp_enqueue_script(
|
862 |
+
'ect-food-many-items',
|
863 |
+
plugin_dir_url( __FILE__ ) . 'js/ect-food-menu-many-items.js',
|
864 |
+
array( 'jquery' ),
|
865 |
+
$this->version,
|
866 |
+
true
|
867 |
+
);
|
868 |
+
}
|
869 |
+
|
870 |
+
function process_form_request() {
|
871 |
+
if ( !isset( $_POST['ect_food_title'] ) || !is_array( $_POST['ect_food_title'] ) ) {
|
872 |
+
return;
|
873 |
+
}
|
874 |
+
|
875 |
+
$is_ajax = !empty( $_POST['ajax'] );
|
876 |
+
|
877 |
+
if ( $is_ajax ) {
|
878 |
+
check_ajax_referer( 'ect_food_many_items' );
|
879 |
+
} else {
|
880 |
+
check_admin_referer( 'ect_food_many_items' );
|
881 |
+
}
|
882 |
+
|
883 |
+
foreach ( array_keys( $_POST['ect_food_title'] ) as $key ) :
|
884 |
+
// $_POST is already slashed
|
885 |
+
$post_details = array(
|
886 |
+
'post_status' => 'publish',
|
887 |
+
'post_type' => self::MENU_ITEM_POST_TYPE,
|
888 |
+
'post_content' => $_POST['ect_food_content'][$key],
|
889 |
+
'post_title' => $_POST['ect_food_title'][$key],
|
890 |
+
'tax_input' => array(
|
891 |
+
self::MENU_ITEM_LABEL_TAX => $_POST['ect_food_labels'][$key],
|
892 |
+
self::MENU_TAX => isset( $_POST['ect_food_menu_tax'] ) ? $_POST['ect_food_menu_tax'] : null,
|
893 |
+
),
|
894 |
+
);
|
895 |
+
|
896 |
+
$post_id = wp_insert_post( $post_details );
|
897 |
+
if ( !$post_id || is_wp_error( $post_id ) ) {
|
898 |
+
continue;
|
899 |
+
}
|
900 |
+
|
901 |
+
$this->set_price( $post_id, isset( $_POST['ect_food_price'][$key] ) ? stripslashes( $_POST['ect_food_price'][$key] ) : '' );
|
902 |
+
|
903 |
+
if ( $is_ajax ) :
|
904 |
+
$post = get_post( $post_id );
|
905 |
+
$GLOBALS['post'] = $post;
|
906 |
+
setup_postdata( $post );
|
907 |
+
|
908 |
+
?>
|
909 |
+
<td><?php the_title(); ?></td>
|
910 |
+
<td class="ect-food-price"><?php $this->display_price(); ?></td>
|
911 |
+
<td><?php $this->list_labels( $post_id ); ?></td>
|
912 |
+
<td><?php the_content(); ?></td>
|
913 |
+
<?php
|
914 |
+
endif;
|
915 |
+
|
916 |
+
endforeach;
|
917 |
+
|
918 |
+
if ( $is_ajax ) {
|
919 |
+
exit;
|
920 |
+
}
|
921 |
+
|
922 |
+
wp_safe_redirect( admin_url( 'edit.php?post_type=' . self::MENU_ITEM_POST_TYPE ) );
|
923 |
+
exit;
|
924 |
+
}
|
925 |
+
|
926 |
+
function add_many_new_items_page() {
|
927 |
+
?>
|
928 |
+
<div class="wrap">
|
929 |
+
<h2><?php esc_html_e( 'Add Many Items', 'essential-content-types' ); ?></h2>
|
930 |
+
|
931 |
+
<p><?php _e( 'Use the <kbd>TAB</kbd> key on your keyboard to move between colums and the <kbd>ENTER</kbd> or <kbd>RETURN</kbd> key to save each row and move on to the next.', 'essential-content-types' ); ?></p>
|
932 |
+
|
933 |
+
<form method="post" action="" enctype="multipart/form-data">
|
934 |
+
<p><h3><?php esc_html_e( 'Add to section:', 'essential-content-types' ); ?> <?php wp_dropdown_categories( array(
|
935 |
+
'id' => 'ect-food-menu-tax',
|
936 |
+
'name' => 'ect_food_menu_tax',
|
937 |
+
'taxonomy' => self::MENU_TAX,
|
938 |
+
'hide_empty' => false,
|
939 |
+
'hierarchical' => true,
|
940 |
+
) ); ?></h3></p>
|
941 |
+
|
942 |
+
<table class="many-items-table wp-list-table widefat">
|
943 |
+
<thead>
|
944 |
+
<tr>
|
945 |
+
<th scope="col"><?php esc_html_e( 'Name', 'essential-content-types' ); ?></th>
|
946 |
+
<th scope="col" class="ect-food-price"><?php esc_html_e( 'Price', 'essential-content-types' ); ?></th>
|
947 |
+
<th scope="col"><?php _e( 'Labels: <small>spicy, favorite, etc. <em>Separate Labels with commas</em></small>', 'essential-content-types' ); ?></th>
|
948 |
+
<th scope="col"><?php esc_html_e( 'Description', 'essential-content-types' ); ?></th>
|
949 |
+
</tr>
|
950 |
+
</thead>
|
951 |
+
<tbody>
|
952 |
+
<tr>
|
953 |
+
<td><input type="text" name="ect_food_title[]" aria-required="true" /></td>
|
954 |
+
<td class="ect-food-price"><input type="text" name="ect_food_price[]" /></td>
|
955 |
+
<td><input type="text" name="ect_food_labels[]" /></td>
|
956 |
+
<td><textarea name="ect_food_content[]" cols="20" rows="1"></textarea>
|
957 |
+
</tr>
|
958 |
+
</tbody>
|
959 |
+
<tbody>
|
960 |
+
<tr>
|
961 |
+
<td><input type="text" name="ect_food_title[]" aria-required="true" /></td>
|
962 |
+
<td class="ect-food-price"><input type="text" name="ect_food_price[]" /></td>
|
963 |
+
<td><input type="text" name="ect_food_labels[]" /></td>
|
964 |
+
<td><textarea name="ect_food_content[]" cols="20" rows="1"></textarea>
|
965 |
+
</tr>
|
966 |
+
</tbody>
|
967 |
+
<tfoot>
|
968 |
+
<tr>
|
969 |
+
<th><a class="button button-secondary ect-food-new-row"><span class="dashicon dashicon-plus"></span> <?php esc_html_e( 'New Row' , 'essential-content-types' ); ?></a></th>
|
970 |
+
<th class="ect-food-price"></th>
|
971 |
+
<th></th>
|
972 |
+
<th></th>
|
973 |
+
</tr>
|
974 |
+
</tfoot>
|
975 |
+
</table>
|
976 |
+
|
977 |
+
<p class="submit">
|
978 |
+
<input type="submit" class="button-primary" value="<?php esc_attr_e( 'Add These New Menu Items', 'essential-content-types' ); ?>" />
|
979 |
+
<?php wp_nonce_field( 'ect_food_many_items' ); ?>
|
980 |
+
</p>
|
981 |
+
</form>
|
982 |
+
</div>
|
983 |
+
<?php
|
984 |
+
}
|
985 |
+
|
986 |
+
/* Edit One Item */
|
987 |
+
|
988 |
+
function register_menu_item_meta_boxes() {
|
989 |
+
wp_enqueue_script( 'ect-food-menu-checkboxes' );
|
990 |
+
|
991 |
+
add_meta_box( 'menu_item_price', __( 'Price', 'essential-content-types' ), array( $this, 'menu_item_price_meta_box' ), null, 'side', 'high' );
|
992 |
+
}
|
993 |
+
|
994 |
+
function menu_item_price_meta_box( $post, $meta_box ) {
|
995 |
+
$price = $this->get_price( $post->ID );
|
996 |
+
?>
|
997 |
+
<label for="ect-food-price-<?php echo (int) $post->ID; ?>" class="screen-reader-text"><?php esc_html_e( 'Price', 'essential-content-types' ); ?></label>
|
998 |
+
<input type="text" id="ect-food-price-<?php echo (int) $post->ID; ?>" class="widefat" name="ect_food_price[<?php echo (int) $post->ID; ?>]" value="<?php echo esc_attr( $price ); ?>" />
|
999 |
+
<?php
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
function add_post_meta( $post_id ) {
|
1003 |
+
if ( !isset( $_POST['ect_food_price'][$post_id] ) ) {
|
1004 |
+
return;
|
1005 |
+
}
|
1006 |
+
|
1007 |
+
$this->set_price( $post_id, stripslashes( $_POST['ect_food_price'][$post_id] ) );
|
1008 |
+
}
|
1009 |
+
|
1010 |
+
/* Data */
|
1011 |
+
|
1012 |
+
function get_menus( $args = array() ) {
|
1013 |
+
$args = wp_parse_args( $args, array(
|
1014 |
+
'hide_empty' => false,
|
1015 |
+
) );
|
1016 |
+
|
1017 |
+
$terms = get_terms( self::MENU_TAX, $args );
|
1018 |
+
if ( !$terms || is_wp_error( $terms ) ) {
|
1019 |
+
return array();
|
1020 |
+
}
|
1021 |
+
|
1022 |
+
$terms_by_id = array();
|
1023 |
+
foreach ( $terms as $term ) {
|
1024 |
+
$terms_by_id["{$term->term_id}"] = $term;
|
1025 |
+
}
|
1026 |
+
|
1027 |
+
$term_order = get_option( 'ect_food_menu_order', array() );
|
1028 |
+
|
1029 |
+
$return = array();
|
1030 |
+
foreach ( $term_order as $term_id ) {
|
1031 |
+
if ( isset( $terms_by_id["$term_id"] ) ) {
|
1032 |
+
$return[] = $terms_by_id["$term_id"];
|
1033 |
+
unset( $terms_by_id["$term_id"] );
|
1034 |
+
}
|
1035 |
+
}
|
1036 |
+
|
1037 |
+
foreach ( $terms_by_id as $term_id => $term ) {
|
1038 |
+
$return[] = $term;
|
1039 |
+
}
|
1040 |
+
|
1041 |
+
return $return;
|
1042 |
+
}
|
1043 |
+
|
1044 |
+
function get_menu_item_menu_leaf( $post_id ) {
|
1045 |
+
// Get first menu taxonomy "leaf"
|
1046 |
+
$term_ids = wp_get_object_terms( $post_id, self::MENU_TAX, array( 'fields' => 'ids' ) );
|
1047 |
+
|
1048 |
+
foreach ( $term_ids as $term_id ) {
|
1049 |
+
$children = get_term_children( $term_id, self::MENU_TAX );
|
1050 |
+
if ( ! $children ) {
|
1051 |
+
break;
|
1052 |
+
}
|
1053 |
+
}
|
1054 |
+
|
1055 |
+
if ( ! isset( $term_id ) ) {
|
1056 |
+
return false;
|
1057 |
+
}
|
1058 |
+
|
1059 |
+
return get_term( $term_id, self::MENU_TAX );
|
1060 |
+
|
1061 |
+
}
|
1062 |
+
|
1063 |
+
function list_labels( $post_id = 0 ) {
|
1064 |
+
$post = get_post( $post_id );
|
1065 |
+
echo get_the_term_list( $post->ID, self::MENU_ITEM_LABEL_TAX, '', _x( ', ', 'Nova label separator', 'essential-content-types' ), '' );
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
function list_admin_labels( $post_id = 0 ) {
|
1069 |
+
$post = get_post( $post_id );
|
1070 |
+
$labels = get_the_terms( $post->ID, self::MENU_ITEM_LABEL_TAX );
|
1071 |
+
if ( !empty( $labels ) ) {
|
1072 |
+
$out = array();
|
1073 |
+
foreach ( $labels as $label ) {
|
1074 |
+
$out[] = sprintf( '<a href="%s">%s</a>',
|
1075 |
+
esc_url( add_query_arg( array(
|
1076 |
+
'post_type' => self::MENU_ITEM_POST_TYPE,
|
1077 |
+
'taxonomy' => self::MENU_ITEM_LABEL_TAX,
|
1078 |
+
'term' => $label->slug
|
1079 |
+
), 'edit.php' ) ),
|
1080 |
+
esc_html( sanitize_term_field( 'name', $label->name, $label->term_id, self::MENU_ITEM_LABEL_TAX, 'display' ) )
|
1081 |
+
);
|
1082 |
+
}
|
1083 |
+
|
1084 |
+
echo join( _x( ', ', 'Nova label separator', 'essential-content-types' ), $out );
|
1085 |
+
} else {
|
1086 |
+
esc_html_e( 'No Labels', 'essential-content-types' );
|
1087 |
+
}
|
1088 |
+
}
|
1089 |
+
|
1090 |
+
function set_price( $post_id = 0, $price = '' ) {
|
1091 |
+
$post = get_post( $post_id );
|
1092 |
+
|
1093 |
+
return update_post_meta( $post->ID, 'ect_food_price', $price );
|
1094 |
+
}
|
1095 |
+
|
1096 |
+
function get_price( $post_id = 0 ) {
|
1097 |
+
$post = get_post( $post_id );
|
1098 |
+
|
1099 |
+
return get_post_meta( $post->ID, 'ect_food_price', true );
|
1100 |
+
}
|
1101 |
+
|
1102 |
+
function display_price( $post_id = 0 ) {
|
1103 |
+
echo esc_html( $this->get_price( $post_id ) );
|
1104 |
+
}
|
1105 |
+
|
1106 |
+
/* Menu Item Loop Markup */
|
1107 |
+
|
1108 |
+
/* Does not support nested loops */
|
1109 |
+
|
1110 |
+
function get_menu_item_loop_markup( $field = null ) {
|
1111 |
+
return $this->menu_item_loop_markup;
|
1112 |
+
}
|
1113 |
+
|
1114 |
+
/**
|
1115 |
+
* Sets up the loop markup.
|
1116 |
+
* Attached to the 'template_include' *filter*,
|
1117 |
+
* which fires only during a real blog view (not in admin, feeds, etc.)
|
1118 |
+
*
|
1119 |
+
* @param string Template File
|
1120 |
+
* @return string Template File. VERY Important.
|
1121 |
+
*/
|
1122 |
+
function setup_menu_item_loop_markup__in_filter( $template ) {
|
1123 |
+
add_action( 'loop_start', array( $this, 'start_menu_item_loop' ) );
|
1124 |
+
|
1125 |
+
return $template;
|
1126 |
+
}
|
1127 |
+
|
1128 |
+
/**
|
1129 |
+
* If the Query is a Menu Item Query, start outputing the Menu Item Loop Marku
|
1130 |
+
* Attached to the 'loop_start' action.
|
1131 |
+
*
|
1132 |
+
* @param WP_Query
|
1133 |
+
*/
|
1134 |
+
function start_menu_item_loop( $query ) {
|
1135 |
+
if ( !$this->is_menu_item_query( $query ) ) {
|
1136 |
+
return;
|
1137 |
+
}
|
1138 |
+
|
1139 |
+
$this->menu_item_loop_last_term_id = false;
|
1140 |
+
$this->menu_item_loop_current_term = false;
|
1141 |
+
|
1142 |
+
add_action( 'the_post', array( $this, 'menu_item_loop_each_post' ) );
|
1143 |
+
add_action( 'loop_end', array( $this, 'stop_menu_item_loop' ) );
|
1144 |
+
}
|
1145 |
+
|
1146 |
+
/**
|
1147 |
+
* Outputs the Menu Item Loop Marku
|
1148 |
+
* Attached to the 'the_post' action.
|
1149 |
+
*
|
1150 |
+
* @param WP_Post
|
1151 |
+
*/
|
1152 |
+
function menu_item_loop_each_post( $post ) {
|
1153 |
+
$this->menu_item_loop_current_term = $this->get_menu_item_menu_leaf( $post->ID );
|
1154 |
+
|
1155 |
+
if ( false === $this->menu_item_loop_last_term_id ) {
|
1156 |
+
// We're at the very beginning of the loop
|
1157 |
+
|
1158 |
+
$this->menu_item_loop_open_element( 'menu' ); // Start a new menu section
|
1159 |
+
$this->menu_item_loop_header(); // Output the menu's header
|
1160 |
+
} elseif ( $this->menu_item_loop_last_term_id != $this->menu_item_loop_current_term->term_id ) {
|
1161 |
+
// We're not at the very beginning but still need to start a new menu section. End the previous menu section first.
|
1162 |
+
|
1163 |
+
$this->menu_item_loop_close_element( 'menu' ); // End the previous menu section
|
1164 |
+
$this->menu_item_loop_open_element( 'menu' ); // Start a new menu section
|
1165 |
+
$this->menu_item_loop_header(); // Output the menu's header
|
1166 |
+
}
|
1167 |
+
|
1168 |
+
$this->menu_item_loop_last_term_id = $this->menu_item_loop_current_term->term_id;
|
1169 |
+
}
|
1170 |
+
|
1171 |
+
/**
|
1172 |
+
* If the Query is a Menu Item Query, stop outputing the Menu Item Loop Marku
|
1173 |
+
* Attached to the 'loop_end' action.
|
1174 |
+
*
|
1175 |
+
* @param WP_Query
|
1176 |
+
*/
|
1177 |
+
function stop_menu_item_loop( $query ) {
|
1178 |
+
if ( !$this->is_menu_item_query( $query ) ) {
|
1179 |
+
return;
|
1180 |
+
}
|
1181 |
+
|
1182 |
+
remove_action( 'the_post', array( $this, 'menu_item_loop_each_post' ) );
|
1183 |
+
remove_action( 'loop_start', array( $this, 'start_menu_item_loop' ) );
|
1184 |
+
remove_action( 'loop_end', array( $this, 'stop_menu_item_loop' ) );
|
1185 |
+
|
1186 |
+
$this->menu_item_loop_close_element( 'menu' ); // End the last menu section
|
1187 |
+
}
|
1188 |
+
|
1189 |
+
/**
|
1190 |
+
* Outputs the Menu Group Header
|
1191 |
+
*/
|
1192 |
+
function menu_item_loop_header() {
|
1193 |
+
$this->menu_item_loop_open_element( 'menu_header' );
|
1194 |
+
$this->menu_item_loop_open_element( 'menu_title' );
|
1195 |
+
echo esc_html( $this->menu_item_loop_current_term->name ); // @todo tax filter
|
1196 |
+
$this->menu_item_loop_close_element( 'menu_title' );
|
1197 |
+
if ( $this->menu_item_loop_current_term->description ) :
|
1198 |
+
$this->menu_item_loop_open_element( 'menu_description' );
|
1199 |
+
echo esc_html( $this->menu_item_loop_current_term->description ); // @todo kses, tax filter
|
1200 |
+
$this->menu_item_loop_close_element( 'menu_description' );
|
1201 |
+
endif;
|
1202 |
+
$this->menu_item_loop_close_element( 'menu_header' );
|
1203 |
+
}
|
1204 |
+
|
1205 |
+
/**
|
1206 |
+
* Outputs a Menu Item Markup element opening tag
|
1207 |
+
*
|
1208 |
+
* @param string $field - Menu Item Markup settings field.
|
1209 |
+
*/
|
1210 |
+
function menu_item_loop_open_element( $field ) {
|
1211 |
+
$markup = $this->get_menu_item_loop_markup();
|
1212 |
+
/**
|
1213 |
+
* Filter a menu item's element opening tag.
|
1214 |
+
*
|
1215 |
+
* @module custom-content-types
|
1216 |
+
*
|
1217 |
+
* @since 4.4.0
|
1218 |
+
*
|
1219 |
+
* @param string $tag Menu item's element opening tag.
|
1220 |
+
* @param string $field Menu Item Markup settings field.
|
1221 |
+
* @param array $markup Array of markup elements for the menu item.
|
1222 |
+
* @param false|object $term Taxonomy term for current menu item.
|
1223 |
+
*/
|
1224 |
+
echo apply_filters(
|
1225 |
+
'essential-content-types_ect_food_menu_item_loop_open_element',
|
1226 |
+
'<' . tag_escape( $markup["{$field}_tag"] ) . $this->menu_item_loop_class( $markup["{$field}_class"] ) . ">\n",
|
1227 |
+
$field,
|
1228 |
+
$markup,
|
1229 |
+
$this->menu_item_loop_current_term
|
1230 |
+
);
|
1231 |
+
}
|
1232 |
+
|
1233 |
+
/**
|
1234 |
+
* Outputs a Menu Item Markup element closing tag
|
1235 |
+
*
|
1236 |
+
* @param string $field - Menu Item Markup settings field
|
1237 |
+
*/
|
1238 |
+
function menu_item_loop_close_element( $field ) {
|
1239 |
+
$markup = $this->get_menu_item_loop_markup();
|
1240 |
+
/**
|
1241 |
+
* Filter a menu item's element closing tag.
|
1242 |
+
*
|
1243 |
+
* @module custom-content-types
|
1244 |
+
*
|
1245 |
+
* @since 4.4.0
|
1246 |
+
*
|
1247 |
+
* @param string $tag Menu item's element closing tag.
|
1248 |
+
* @param string $field Menu Item Markup settings field.
|
1249 |
+
* @param array $markup Array of markup elements for the menu item.
|
1250 |
+
* @param false|object $term Taxonomy term for current menu item.
|
1251 |
+
*/
|
1252 |
+
echo apply_filters(
|
1253 |
+
'essential-content-types_ect_food_menu_item_loop_close_element',
|
1254 |
+
'</' . tag_escape( $markup["{$field}_tag"] ) . ">\n",
|
1255 |
+
$field,
|
1256 |
+
$markup,
|
1257 |
+
$this->menu_item_loop_current_term
|
1258 |
+
);
|
1259 |
+
}
|
1260 |
+
|
1261 |
+
/**
|
1262 |
+
* Returns a Menu Item Markup element's class attribute.
|
1263 |
+
*
|
1264 |
+
* @param string $class Class name.
|
1265 |
+
* @return string HTML class attribute with leading whitespace.
|
1266 |
+
*/
|
1267 |
+
function menu_item_loop_class( $class ) {
|
1268 |
+
if ( ! $class ) {
|
1269 |
+
return '';
|
1270 |
+
}
|
1271 |
+
|
1272 |
+
/**
|
1273 |
+
* Filter a menu Item Markup element's class attribute.
|
1274 |
+
*
|
1275 |
+
* @module custom-content-types
|
1276 |
+
*
|
1277 |
+
* @since 4.4.0
|
1278 |
+
*
|
1279 |
+
* @param string $tag Menu Item Markup element's class attribute.
|
1280 |
+
* @param string $class Menu Item Class name.
|
1281 |
+
* @param false|object $term Taxonomy term for current menu item.
|
1282 |
+
*/
|
1283 |
+
return apply_filters(
|
1284 |
+
'essential-content-types_ect_food_menu_item_loop_class',
|
1285 |
+
' class="' . esc_attr( $class ) . '"',
|
1286 |
+
$class,
|
1287 |
+
$this->menu_item_loop_current_term
|
1288 |
+
);
|
1289 |
+
}
|
1290 |
+
|
1291 |
+
/**
|
1292 |
+
* Our [portfolio] shortcode.
|
1293 |
+
* Prints Portfolio data styled to look good on *any* theme.
|
1294 |
+
*
|
1295 |
+
* @return ect_food_shortcode_html
|
1296 |
+
*/
|
1297 |
+
static function ect_food_shortcode( $atts ) {
|
1298 |
+
// Default attributes
|
1299 |
+
$atts = shortcode_atts( array(
|
1300 |
+
'include_type' => false,
|
1301 |
+
'include_tag' => false,
|
1302 |
+
'showposts' => -1,
|
1303 |
+
), $atts, 'food_menu' );
|
1304 |
+
|
1305 |
+
// A little sanitization
|
1306 |
+
if ( $atts['include_type'] ) {
|
1307 |
+
$atts['include_type'] = explode( ',', str_replace( ' ', '', $atts['include_type'] ) );
|
1308 |
+
}
|
1309 |
+
|
1310 |
+
if ( $atts['include_tag'] ) {
|
1311 |
+
$atts['include_tag'] = explode( ',', str_replace( ' ', '', $atts['include_tag'] ) );
|
1312 |
+
}
|
1313 |
+
|
1314 |
+
$atts['showposts'] = intval( $atts['showposts'] );
|
1315 |
+
|
1316 |
+
// enqueue shortcode styles when shortcode is used
|
1317 |
+
wp_enqueue_style( 'ect-food-menu-style', plugins_url( 'css/food-menu-shortcode.css', __FILE__ ), array(), '20140326' );
|
1318 |
+
|
1319 |
+
return self::ect_food_shortcode_html( $atts );
|
1320 |
+
}
|
1321 |
+
|
1322 |
+
/**
|
1323 |
+
* Query to retrieve entries from the Portfolio post_type.
|
1324 |
+
*
|
1325 |
+
* @return object
|
1326 |
+
*/
|
1327 |
+
static function ect_food_query( $atts ) {
|
1328 |
+
// Default query arguments
|
1329 |
+
$default = array(
|
1330 |
+
'posts_per_page' => $atts['showposts'],
|
1331 |
+
);
|
1332 |
+
|
1333 |
+
$args = wp_parse_args( $atts, $default );
|
1334 |
+
$args['post_type'] = self::MENU_ITEM_POST_TYPE; // Force this post type
|
1335 |
+
|
1336 |
+
if ( false != $atts['include_type'] || false != $atts['include_tag'] ) {
|
1337 |
+
$args['tax_query'] = array();
|
1338 |
+
}
|
1339 |
+
|
1340 |
+
// If 'include_type' has been set use it on the main query
|
1341 |
+
if ( false != $atts['include_type'] ) {
|
1342 |
+
array_push( $args['tax_query'], array(
|
1343 |
+
'taxonomy' => self::MENU_TAX,
|
1344 |
+
'field' => 'slug',
|
1345 |
+
'terms' => $atts['include_type'],
|
1346 |
+
) );
|
1347 |
+
}
|
1348 |
+
|
1349 |
+
// If 'include_tag' has been set use it on the main query
|
1350 |
+
if ( false != $atts['include_tag'] ) {
|
1351 |
+
array_push( $args['tax_query'], array(
|
1352 |
+
'taxonomy' => self::MENU_ITEM_LABEL_TAX,
|
1353 |
+
'field' => 'slug',
|
1354 |
+
'terms' => $atts['include_tag'],
|
1355 |
+
) );
|
1356 |
+
}
|
1357 |
+
|
1358 |
+
if ( false != $atts['include_type'] && false != $atts['include_tag'] ) {
|
1359 |
+
$args['tax_query']['relation'] = 'AND';
|
1360 |
+
}
|
1361 |
+
|
1362 |
+
// Run the query and return
|
1363 |
+
$query = new WP_Query( $args );
|
1364 |
+
return $query;
|
1365 |
+
}
|
1366 |
+
|
1367 |
+
/**
|
1368 |
+
* The Portfolio shortcode loop.
|
1369 |
+
*
|
1370 |
+
* @todo add theme color styles
|
1371 |
+
* @return html
|
1372 |
+
*/
|
1373 |
+
static function ect_food_shortcode_html( $atts ) {
|
1374 |
+
|
1375 |
+
$query = self::ect_food_query( $atts );
|
1376 |
+
$ect_food_index_number = 0;
|
1377 |
+
|
1378 |
+
ob_start();
|
1379 |
+
|
1380 |
+
// If we have posts, create the html
|
1381 |
+
// with food menu markup
|
1382 |
+
if ( $query->have_posts() ) {
|
1383 |
+
|
1384 |
+
// Render styles
|
1385 |
+
//self::themecolor_styles();
|
1386 |
+
|
1387 |
+
?>
|
1388 |
+
|
1389 |
+
<div class="ect-food-menu-shortcode">
|
1390 |
+
<?php // open .ect-food-menu-shortcode
|
1391 |
+
|
1392 |
+
// Construct the loop...
|
1393 |
+
while ( $query->have_posts() ) {
|
1394 |
+
$query->the_post();
|
1395 |
+
$post_id = get_the_ID(); ?>
|
1396 |
+
<!-- Menu display template -->
|
1397 |
+
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
1398 |
+
<div class="hentry-inner">
|
1399 |
+
<div class="entry-container">
|
1400 |
+
<div class="entry-description">
|
1401 |
+
<header class="entry-header">
|
1402 |
+
<?php the_title( '<h2 class="entry-title"><a href="' . esc_url( get_the_permalink() ) . '">', '</a></h2>' ); ?>
|
1403 |
+
</header>
|
1404 |
+
|
1405 |
+
<div class="entry-content">
|
1406 |
+
<?php the_excerpt(); ?>
|
1407 |
+
</div>
|
1408 |
+
</div>
|
1409 |
+
|
1410 |
+
<?php
|
1411 |
+
|
1412 |
+
$type = get_theme_mod( 'foodie_world_food_menu_type', 'demo' );
|
1413 |
+
|
1414 |
+
if ( 'cpt' === $type ) :
|
1415 |
+
?>
|
1416 |
+
<div class="entry-price">
|
1417 |
+
<p class="item-price"><?php echo esc_html( get_post_meta( get_the_ID(), 'ect_food_price', true ) ); ?></p>
|
1418 |
+
</div>
|
1419 |
+
<?php endif; ?>
|
1420 |
+
</div>
|
1421 |
+
</div><!-- .hentry-inner -->
|
1422 |
+
</article><!-- .hentry -->
|
1423 |
+
|
1424 |
+
<?php } // end of while loop
|
1425 |
+
|
1426 |
+
wp_reset_postdata();
|
1427 |
+
|
1428 |
+
// If comments are open or we have at least one comment, load up the comment template
|
1429 |
+
if ( comments_open() || '0' != get_comments_number() ) {
|
1430 |
+
comments_template( '', true );
|
1431 |
+
}
|
1432 |
+
?>
|
1433 |
+
</div><!-- .section-content-wrapper -->
|
1434 |
+
<?php
|
1435 |
+
} else { ?>
|
1436 |
+
<p><em><?php esc_html_e( 'Your Food Menu Archive currently has no entries. You can start creating them on your dashboard.', 'essential-content-types' ); ?></p></em>
|
1437 |
+
<?php
|
1438 |
+
}
|
1439 |
+
$html = ob_get_clean();
|
1440 |
+
|
1441 |
+
// If there is a [food-menu] within a [food-menu], remove the shortcode
|
1442 |
+
if ( has_shortcode( $html, 'food-menu' ) ){
|
1443 |
+
remove_shortcode( 'food-menu' );
|
1444 |
+
}
|
1445 |
+
|
1446 |
+
// Return the HTML block
|
1447 |
+
return $html;
|
1448 |
+
}
|
1449 |
+
}
|
1450 |
+
|
1451 |
+
add_action( 'init', array( 'Essential_Content_Food_Menu', 'init' ) );
|
1452 |
+
|
1453 |
+
|
1454 |
+
/**
|
1455 |
+
* Add Food Menu support
|
1456 |
+
*/
|
1457 |
+
function essential_content_food_menu_support() {
|
1458 |
+
/*
|
1459 |
+
* Adding theme support for Food Menu Item CPT.
|
1460 |
+
*/
|
1461 |
+
add_theme_support( 'ect_food_menu_item' );
|
1462 |
+
}
|
1463 |
+
add_action( 'after_setup_theme', 'essential_content_food_menu_support' );
|
admin/class-portfolio.php
CHANGED
@@ -401,10 +401,16 @@ class Essential_Content_Jetpack_Portfolio {
|
|
401 |
return;
|
402 |
}
|
403 |
|
|
|
|
|
|
|
|
|
|
|
404 |
$wp_customize->add_section( 'jetpack_portfolio', array(
|
405 |
-
'title'
|
406 |
-
'theme_supports'
|
407 |
-
'priority'
|
|
|
408 |
) );
|
409 |
|
410 |
if ( isset( $options[0]['title'] ) && true === $options[0]['title'] ) {
|
@@ -859,4 +865,4 @@ function essential_content_portfolio_support() {
|
|
859 |
'featured-image' => true,
|
860 |
) );
|
861 |
}
|
862 |
-
add_action( 'after_setup_theme', 'essential_content_portfolio_support' );
|
401 |
return;
|
402 |
}
|
403 |
|
404 |
+
$wp_customize->add_panel( 'ect_plugin_options', array(
|
405 |
+
'title' => esc_html__( 'Essential Content Types Plugin Options', 'essential-content-types' ),
|
406 |
+
'priority' => 1,
|
407 |
+
) );
|
408 |
+
|
409 |
$wp_customize->add_section( 'jetpack_portfolio', array(
|
410 |
+
'title' => esc_html__( 'Portfolio', 'essential-content-types' ),
|
411 |
+
'theme_supports' => self::CUSTOM_POST_TYPE,
|
412 |
+
'priority' => 130,
|
413 |
+
'panel' => 'ect_plugin_options',
|
414 |
) );
|
415 |
|
416 |
if ( isset( $options[0]['title'] ) && true === $options[0]['title'] ) {
|
865 |
'featured-image' => true,
|
866 |
) );
|
867 |
}
|
868 |
+
add_action( 'after_setup_theme', 'essential_content_portfolio_support' );
|
admin/class-service.php
CHANGED
@@ -267,9 +267,15 @@ class Essential_Content_Service {
|
|
267 |
* Adds service section to the Customizer.
|
268 |
*/
|
269 |
function customize_register( $wp_customize ) {
|
|
|
|
|
|
|
|
|
|
|
270 |
$wp_customize->add_section( 'ect_service', array(
|
271 |
-
'title'
|
272 |
-
'priority'
|
|
|
273 |
) );
|
274 |
|
275 |
$wp_customize->add_setting( 'ect_service_title', array(
|
@@ -710,4 +716,4 @@ class Essential_Content_Service {
|
|
710 |
}
|
711 |
}
|
712 |
}
|
713 |
-
add_action( 'init', array( 'Essential_Content_Service', 'init' ) );
|
267 |
* Adds service section to the Customizer.
|
268 |
*/
|
269 |
function customize_register( $wp_customize ) {
|
270 |
+
$wp_customize->add_panel( 'ect_plugin_options', array(
|
271 |
+
'title' => esc_html__( 'Essential Content Types Plugin Options', 'essential-content-types' ),
|
272 |
+
'priority' => 1,
|
273 |
+
) );
|
274 |
+
|
275 |
$wp_customize->add_section( 'ect_service', array(
|
276 |
+
'title' => esc_html__( 'Services', 'essential-content-types' ),
|
277 |
+
'priority' => 130,
|
278 |
+
'panel' => 'ect_plugin_options',
|
279 |
) );
|
280 |
|
281 |
$wp_customize->add_setting( 'ect_service_title', array(
|
716 |
}
|
717 |
}
|
718 |
}
|
719 |
+
add_action( 'init', array( 'Essential_Content_Service', 'init' ) );
|
admin/class-testimonial.php
CHANGED
@@ -425,10 +425,16 @@ class Essential_Content_Jetpack_Testimonial {
|
|
425 |
function customize_register( $wp_customize ) {
|
426 |
essential_content_testimonial_custom_control_classes();
|
427 |
|
|
|
|
|
|
|
|
|
|
|
428 |
$wp_customize->add_section( 'jetpack_testimonials', array(
|
429 |
'title' => esc_html__( 'Testimonials', 'essential-content-types' ),
|
430 |
'theme_supports' => self::CUSTOM_POST_TYPE,
|
431 |
'priority' => 130,
|
|
|
432 |
) );
|
433 |
|
434 |
$wp_customize->add_setting( 'jetpack_testimonials[page-title]', array(
|
425 |
function customize_register( $wp_customize ) {
|
426 |
essential_content_testimonial_custom_control_classes();
|
427 |
|
428 |
+
$wp_customize->add_panel( 'ect_plugin_options', array(
|
429 |
+
'title' => esc_html__( 'Essential Content Types Plugin Options', 'essential-content-types' ),
|
430 |
+
'priority' => 1,
|
431 |
+
) );
|
432 |
+
|
433 |
$wp_customize->add_section( 'jetpack_testimonials', array(
|
434 |
'title' => esc_html__( 'Testimonials', 'essential-content-types' ),
|
435 |
'theme_supports' => self::CUSTOM_POST_TYPE,
|
436 |
'priority' => 130,
|
437 |
+
'panel' => 'ect_plugin_options',
|
438 |
) );
|
439 |
|
440 |
$wp_customize->add_setting( 'jetpack_testimonials[page-title]', array(
|
admin/css/ect-food-menu-edit-items.css
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.widefat .menu-label-row td {
|
2 |
+
border-bottom-width: 1px;
|
3 |
+
}
|
4 |
+
.widefat .menu-label-row td h3 {
|
5 |
+
padding-left: 30px;
|
6 |
+
}
|
7 |
+
.widefat .menu-order-value {
|
8 |
+
width: 2.5em;
|
9 |
+
text-align: center;
|
10 |
+
}
|
11 |
+
.widefat .menu-label-row, .widefat .menu-label-row td {
|
12 |
+
background-color: #d6d6d6;
|
13 |
+
color: #111;
|
14 |
+
border: 0 none;
|
15 |
+
}
|
16 |
+
.ui-sortable .type-ect_food_menu_item {
|
17 |
+
cursor: move;
|
18 |
+
}
|
19 |
+
.tablenav .button-reorder {
|
20 |
+
margin-top: 4px;
|
21 |
+
}
|
22 |
+
.tablenav .view-switch a, .tablenav div.tablenav-pages {
|
23 |
+
display: none;
|
24 |
+
}
|
admin/css/ect-food-menu-font.css
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@font-face {
|
2 |
+
font-family: 'nova-font';
|
3 |
+
src: url('../fonts/nova.eot');
|
4 |
+
}
|
5 |
+
@font-face {
|
6 |
+
font-family: 'nova-font';
|
7 |
+
src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg5lAuAAAAC8AAAAYGNtYXDL9xqaAAABHAAAADxnYXNwAAAAEAAAAVgAAAAIZ2x5Zrlfj0YAA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AG8AdgBhAFIAZQBnAHUAbABhAHIAbgBvAHYAYQBHAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('woff');
|
9 |
+
font-weight: normal;
|
10 |
+
font-style: normal;
|
11 |
+
}
|
12 |
+
|
13 |
+
#menu-posts-ect_food_menu_item:before,
|
14 |
+
#dashboard_right_now .ect-food-menu-count a:before,
|
15 |
+
#dashboard_right_now .ect-food-menu-count span:before {
|
16 |
+
font-family: 'nova-font';
|
17 |
+
speak: none;
|
18 |
+
font-style: normal;
|
19 |
+
font-weight: normal;
|
20 |
+
font-variant: normal;
|
21 |
+
text-transform: none;
|
22 |
+
line-height: 1;
|
23 |
+
|
24 |
+
/* Better Font Rendering =========== */
|
25 |
+
-webkit-font-smoothing: antialiased;
|
26 |
+
-moz-osx-font-smoothing: grayscale;
|
27 |
+
}
|
28 |
+
#dashboard_right_now .ect-food-menu-count a:before, #dashboard_right_now .ect-food-menu-count span:before {
|
29 |
+
content: '\e603';
|
30 |
+
}
|
admin/css/ect-food-menu-many-items.css
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.many-items-table th, .many-items-table td {
|
2 |
+
width: 25%;
|
3 |
+
}
|
4 |
+
|
5 |
+
.many-items-table input, .many-items-table textarea {
|
6 |
+
width: 100%;
|
7 |
+
}
|
8 |
+
|
9 |
+
.many-items-table input[type=file] {
|
10 |
+
-moz-box-sizing: border-box;
|
11 |
+
-webkit-box-sizing: border-box;
|
12 |
+
-ms-box-sizing: border-box;
|
13 |
+
box-sizing: border-box;
|
14 |
+
}
|
admin/css/ect-food-menu.css
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* edit-items.css
|
2 |
+
-------------------------------------------------------------- */
|
3 |
+
|
4 |
+
.widefat .menu-label-row td {
|
5 |
+
border-bottom-width: 1px;
|
6 |
+
}
|
7 |
+
.widefat .menu-label-row td h3 {
|
8 |
+
padding-left: 30px;
|
9 |
+
}
|
10 |
+
.widefat .menu-label-row td h3 .edit-ect-food-section {
|
11 |
+
font-size: .8em;
|
12 |
+
font-weight: normal;
|
13 |
+
margin-left: 5px;
|
14 |
+
}
|
15 |
+
.widefat .menu-order-value {
|
16 |
+
width: 2.5em;
|
17 |
+
text-align: center;
|
18 |
+
}
|
19 |
+
.widefat .menu-label-row, .widefat .menu-label-row td {
|
20 |
+
background-color: #eee;
|
21 |
+
color: #111;
|
22 |
+
border: 0 none;
|
23 |
+
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
|
24 |
+
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
|
25 |
+
}
|
26 |
+
.ui-sortable .type-ect_food_menu_item {
|
27 |
+
cursor: move;
|
28 |
+
background-color: #fff;
|
29 |
+
}
|
30 |
+
.ui-sortable .type-ect_food_menu_item:nth-child(even) {
|
31 |
+
background-color: #f9f9f9;
|
32 |
+
}
|
33 |
+
.ui-sortable .type-ect_food_menu_item.ui-sortable-helper {
|
34 |
+
-webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
|
35 |
+
box-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
|
36 |
+
}
|
37 |
+
.tablenav .button-reorder {
|
38 |
+
margin-top: 4px;
|
39 |
+
}
|
40 |
+
.tablenav .view-switch a, .tablenav div.tablenav-pages {
|
41 |
+
display: none;
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
/* many-items.css
|
46 |
+
-------------------------------------------------------------- */
|
47 |
+
|
48 |
+
.many-items-table th, .many-items-table td {
|
49 |
+
width: 30%;
|
50 |
+
}
|
51 |
+
|
52 |
+
.many-items-table th.ect-food-price, .many-items-table td.ect-food-price {
|
53 |
+
width: 10%;
|
54 |
+
}
|
55 |
+
|
56 |
+
.many-items-table input, .many-items-table textarea {
|
57 |
+
width: 100%;
|
58 |
+
}
|
59 |
+
|
60 |
+
.many-items-table input[type=file] {
|
61 |
+
-moz-box-sizing: border-box;
|
62 |
+
-webkit-box-sizing: border-box;
|
63 |
+
-ms-box-sizing: border-box;
|
64 |
+
box-sizing: border-box;
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
/* new
|
69 |
+
-------------------------------------------------------------- */
|
70 |
+
|
71 |
+
#the-list tr td:nth-of-type(2) {
|
72 |
+
padding-top: 15px;
|
73 |
+
}
|
74 |
+
|
75 |
+
.ect-food-move-menu-up:before,
|
76 |
+
.ect-food-move-menu-down:before {
|
77 |
+
margin-right: 5px;
|
78 |
+
font: normal 10px/1 'dashicons' !important;
|
79 |
+
speak: none;
|
80 |
+
}
|
81 |
+
|
82 |
+
.ect-food-move-menu-up:before {
|
83 |
+
content: "\f342";
|
84 |
+
}
|
85 |
+
|
86 |
+
.ect-food-move-menu-down:before {
|
87 |
+
content: "\f346";
|
88 |
+
}
|
89 |
+
|
90 |
+
.dashicon:before {
|
91 |
+
font: normal 20px/1 'dashicons';
|
92 |
+
speak: none;
|
93 |
+
top: 5px;
|
94 |
+
display: inline-block;
|
95 |
+
position: relative;
|
96 |
+
-webkit-font-smoothing: antialiased;
|
97 |
+
-moz-osx-font-smoothing: grayscale;
|
98 |
+
text-decoration: none !important;
|
99 |
+
vertical-align: top;
|
100 |
+
}
|
101 |
+
|
102 |
+
.dashicon-plus:before {
|
103 |
+
content: "\f132";
|
104 |
+
}
|
105 |
+
|
106 |
+
.dashicon-edit:before {
|
107 |
+
margin: 2px 5px 0 10px;
|
108 |
+
content: "\f327";
|
109 |
+
font-size: 10px;
|
110 |
+
}
|
admin/css/food-menu-shortcode.css
ADDED
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
body.page-template-menu-page .content-area .singular-content-wrap .entry-content {
|
3 |
+
padding-top: 0;
|
4 |
+
}
|
5 |
+
|
6 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .entry-title {
|
7 |
+
font-family: 'Montserrat', sans-serif;
|
8 |
+
}
|
9 |
+
|
10 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .entry-title {
|
11 |
+
font-size: 18px;
|
12 |
+
font-size: 1.125rem;
|
13 |
+
}
|
14 |
+
|
15 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .entry-title {
|
16 |
+
font-weight: 600;
|
17 |
+
}
|
18 |
+
|
19 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .hentry-inner {
|
20 |
+
border-bottom: 3px solid;
|
21 |
+
padding-bottom: 21px;
|
22 |
+
}
|
23 |
+
|
24 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .entry-container {
|
25 |
+
display: table;
|
26 |
+
position: relative;
|
27 |
+
table-layout: fixed;
|
28 |
+
width: 100%;
|
29 |
+
}
|
30 |
+
|
31 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .entry-header {
|
32 |
+
margin-bottom: 14px;
|
33 |
+
}
|
34 |
+
|
35 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .entry-content {
|
36 |
+
margin-top: 14px;
|
37 |
+
}
|
38 |
+
|
39 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .entry-description {
|
40 |
+
width: 70%;
|
41 |
+
}
|
42 |
+
|
43 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .entry-description,
|
44 |
+
.page-template-menu-page .entry-price {
|
45 |
+
display: table-cell;
|
46 |
+
vertical-align: top;
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .hentry-inner {
|
52 |
+
padding-bottom: 28px;
|
53 |
+
}
|
54 |
+
|
55 |
+
@media screen and (min-width: 48em) {
|
56 |
+
|
57 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .entry-title {
|
58 |
+
font-size: 21px;
|
59 |
+
font-size: 1.3125rem;
|
60 |
+
}
|
61 |
+
|
62 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .hentry-inner {
|
63 |
+
padding-bottom: 28px;
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
.page-template-menu-page .ect-food-menu-shortcode .section-content-wrapper {
|
68 |
+
max-width: 1080px;
|
69 |
+
margin: 0 auto;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
@media screen and (min-width: 50.75em) {
|
74 |
+
|
75 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .hentry-inner {
|
76 |
+
padding-bottom: 0;
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
@media screen and (min-width: 75em) {
|
81 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .entry-title {
|
82 |
+
font-size: 24px;
|
83 |
+
font-size: 1.5rem;
|
84 |
+
}
|
85 |
+
|
86 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .hentry-inner {
|
87 |
+
padding-bottom: 35px;
|
88 |
+
}
|
89 |
+
|
90 |
+
.page-template-menu-page .ect-food-menu-shortcode .archive-content-wrap .hentry {
|
91 |
+
padding-left: 0;
|
92 |
+
padding-right: 0;
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
.page-template-menu-page .ect-food-menu-shortcode .menu-items .hentry-inner {
|
97 |
+
border-color: #f2f2f2;
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
+
.page-template-menu-page .ect-food-menu-shortcode {
|
102 |
+
padding-top: 0px;
|
103 |
+
}
|
104 |
+
|
105 |
+
.page-template-menu-page .ect-food-menu-shortcode .entry-header {
|
106 |
+
padding: 0;
|
107 |
+
text-align: left;
|
108 |
+
}
|
109 |
+
|
110 |
+
.page-template-menu-page .entry-content .ect-food-menu-shortcode a {
|
111 |
+
text-decoration: none;
|
112 |
+
}
|
113 |
+
|
114 |
+
/* From Theme */
|
115 |
+
.page-template-menu-page .content-area .menu-items .entry-container {
|
116 |
+
display: table;
|
117 |
+
position: relative;
|
118 |
+
table-layout: fixed;
|
119 |
+
width: 100%;
|
120 |
+
}
|
121 |
+
|
122 |
+
.page-template-menu-page .content-area .menu-items .entry-header {
|
123 |
+
margin-bottom: 14px;
|
124 |
+
}
|
125 |
+
|
126 |
+
.page-template-menu-page .content-area .menu-items .entry-content {
|
127 |
+
margin-top: 14px;
|
128 |
+
}
|
129 |
+
|
130 |
+
.page-template-menu-page .menu-items .entry-description {
|
131 |
+
width: 70%;
|
132 |
+
}
|
133 |
+
|
134 |
+
.page-template-menu-page .menu-items .entry-description {
|
135 |
+
display: table-cell;
|
136 |
+
vertical-align: top;
|
137 |
+
}
|
admin/js/ect-food-menu-drag-drop.js
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* jshint onevar: false, smarttabs: true */
|
2 |
+
/* global _novaDragDrop */
|
3 |
+
|
4 |
+
(function($){
|
5 |
+
var list;
|
6 |
+
|
7 |
+
function init() {
|
8 |
+
list = $('#the-list');
|
9 |
+
dragMenus();
|
10 |
+
addNonce();
|
11 |
+
addSubmitButton();
|
12 |
+
changeToPost();
|
13 |
+
}
|
14 |
+
|
15 |
+
function dragMenus() {
|
16 |
+
list.sortable({
|
17 |
+
cancel: '.no-items',
|
18 |
+
stop: function( event, ui ) {
|
19 |
+
if ( ui.item.is(':first-child') ) {
|
20 |
+
return list.sortable('cancel');
|
21 |
+
}
|
22 |
+
//
|
23 |
+
reOrder();
|
24 |
+
}
|
25 |
+
});
|
26 |
+
}
|
27 |
+
|
28 |
+
function reOrder() {
|
29 |
+
list.find('.menu-label-row').each(function() {
|
30 |
+
var term_id = $(this).data('term_id');
|
31 |
+
$(this).nextUntil('.menu-label-row').each(function(i) {
|
32 |
+
var row = $(this);
|
33 |
+
row.find('.menu-order-value').val(i);
|
34 |
+
row.find('.ect-food-menu-term').val(term_id);
|
35 |
+
});
|
36 |
+
});
|
37 |
+
}
|
38 |
+
|
39 |
+
function addSubmitButton() {
|
40 |
+
$('.tablenav').prepend('<input type="submit" class="button-primary button-reorder alignright" value="' + _novaDragDrop.reorder + '" name="' + _novaDragDrop.reorderName + '" />');
|
41 |
+
}
|
42 |
+
|
43 |
+
function addNonce() {
|
44 |
+
$('#posts-filter').append('<input type="hidden" name="' + _novaDragDrop.nonceName + '" value="' + _novaDragDrop.nonce + '" />');
|
45 |
+
}
|
46 |
+
|
47 |
+
function changeToPost() {
|
48 |
+
$( '#posts-filter' ).attr( 'method', 'post' );
|
49 |
+
}
|
50 |
+
|
51 |
+
// do it
|
52 |
+
$(document).ready(init);
|
53 |
+
})(jQuery);
|
54 |
+
|
admin/js/ect-food-menu-many-items.js
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* jshint onevar: false, smarttabs: true */
|
2 |
+
|
3 |
+
(function( $ ){
|
4 |
+
var menuSelector, nonceInput, methods;
|
5 |
+
|
6 |
+
methods = {
|
7 |
+
init : function( /*options*/ ) {
|
8 |
+
var $this = this, tbody, row;
|
9 |
+
|
10 |
+
this
|
11 |
+
.on( 'keypress.manyItemsTable', function( event ) {
|
12 |
+
if ( 13 !== event.which ) {
|
13 |
+
return;
|
14 |
+
}
|
15 |
+
|
16 |
+
event.preventDefault();
|
17 |
+
if ( 'function' === typeof FormData ) {
|
18 |
+
methods.submitRow.apply( $this );
|
19 |
+
}
|
20 |
+
methods.addRow.apply( $this );
|
21 |
+
} )
|
22 |
+
.on( 'focus.manyItemsTable', ':input', function( /*event*/ ) {
|
23 |
+
$this.data( 'currentRow', $( this ).parents( 'tr:first' ) );
|
24 |
+
} );
|
25 |
+
|
26 |
+
tbody = this.find( 'tbody:last' );
|
27 |
+
row = tbody.find( 'tr:first' ).clone();
|
28 |
+
|
29 |
+
this.data( 'form', this.parents( 'form:first' ) );
|
30 |
+
this.data( 'tbody', tbody );
|
31 |
+
this.data( 'row', row );
|
32 |
+
this.data( 'currentRow', row );
|
33 |
+
|
34 |
+
menuSelector = $( '#ect-food-menu-tax' );
|
35 |
+
nonceInput = $( '#_wpnonce' );
|
36 |
+
|
37 |
+
return this;
|
38 |
+
},
|
39 |
+
|
40 |
+
destroy : function() {
|
41 |
+
this.off( '.manyItemsTable' );
|
42 |
+
|
43 |
+
return this;
|
44 |
+
},
|
45 |
+
|
46 |
+
submitRow : function() {
|
47 |
+
var submittedRow, currentInputs, allInputs, partialFormData;
|
48 |
+
|
49 |
+
submittedRow = this.data( 'currentRow' );
|
50 |
+
currentInputs = submittedRow.find( ':input' );
|
51 |
+
allInputs = this.data( 'form' ).find( ':input' ).not( currentInputs ).attr( 'disabled', true ).end();
|
52 |
+
|
53 |
+
partialFormData = new FormData( this.data( 'form' ).get( 0 ) );
|
54 |
+
partialFormData.append( 'ajax', '1' );
|
55 |
+
partialFormData.append( 'ect_food_menu_tax', menuSelector.val() );
|
56 |
+
partialFormData.append( '_wpnonce', nonceInput.val() );
|
57 |
+
|
58 |
+
allInputs.attr( 'disabled', false );
|
59 |
+
|
60 |
+
$.ajax( {
|
61 |
+
url: '',
|
62 |
+
type: 'POST',
|
63 |
+
data: partialFormData,
|
64 |
+
processData: false,
|
65 |
+
contentType: false
|
66 |
+
} ).complete( function( xhr ) {
|
67 |
+
submittedRow.html( xhr.responseText );
|
68 |
+
} );
|
69 |
+
|
70 |
+
currentInputs.attr( 'disabled', true );
|
71 |
+
|
72 |
+
return this;
|
73 |
+
},
|
74 |
+
|
75 |
+
addRow : function() {
|
76 |
+
var row = this.data( 'row' ).clone();
|
77 |
+
row.appendTo( this.data( 'tbody' ) );
|
78 |
+
row.find( ':input:first' ).focus();
|
79 |
+
|
80 |
+
return this;
|
81 |
+
}
|
82 |
+
};
|
83 |
+
|
84 |
+
$.fn.manyItemsTable = function( method ) {
|
85 |
+
// Method calling logic
|
86 |
+
if ( methods[method] ) {
|
87 |
+
return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ) );
|
88 |
+
} else if ( typeof method === 'object' || ! method ) {
|
89 |
+
return methods.init.apply( this, arguments );
|
90 |
+
} else {
|
91 |
+
$.error( 'Method ' + method + ' does not exist on jQuery.manyItemsTable' );
|
92 |
+
return this;
|
93 |
+
}
|
94 |
+
};
|
95 |
+
|
96 |
+
$.fn.clickAddRow = function() {
|
97 |
+
var tbody = this.find( 'tbody:last' ),
|
98 |
+
row = tbody.find( 'tr:first' ).clone();
|
99 |
+
|
100 |
+
$( row ).find( 'input, textarea' ).val( '' );
|
101 |
+
$( row ).appendTo( tbody );
|
102 |
+
};
|
103 |
+
|
104 |
+
})( jQuery );
|
105 |
+
|
106 |
+
jQuery( '.many-items-table' ).one( 'focus', ':input', function( event ) {
|
107 |
+
jQuery( event.delegateTarget ).manyItemsTable();
|
108 |
+
} );
|
109 |
+
jQuery( '.many-items-table' ).on( 'click', 'a.ect-food-new-row', function( event ) {
|
110 |
+
jQuery( event.delegateTarget ).clickAddRow();
|
111 |
+
} );
|
112 |
+
|
admin/js/ect-food-menu-menu-checkboxes.js
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* jshint onevar: false, smarttabs: true, devel: true */
|
2 |
+
|
3 |
+
(function($) {
|
4 |
+
var NovaCheckBoxes = {
|
5 |
+
inputs: null,
|
6 |
+
popInputs: null,
|
7 |
+
|
8 |
+
initialize: function() {
|
9 |
+
NovaCheckBoxes.popInputs = $( '#ect_food_menuchecklist-pop' ).find( ':checkbox' );
|
10 |
+
|
11 |
+
NovaCheckBoxes.inputs = $( '#ect_food_menuchecklist' )
|
12 |
+
.find( ':checkbox' )
|
13 |
+
.change( NovaCheckBoxes.checkOne )
|
14 |
+
.change( NovaCheckBoxes.syncPop );
|
15 |
+
|
16 |
+
if ( !NovaCheckBoxes.isChecked() ) {
|
17 |
+
NovaCheckBoxes.checkFirst();
|
18 |
+
}
|
19 |
+
|
20 |
+
NovaCheckBoxes.syncPop();
|
21 |
+
},
|
22 |
+
|
23 |
+
syncPop: function() {
|
24 |
+
NovaCheckBoxes.popInputs.each( function() {
|
25 |
+
var $this = $( this );
|
26 |
+
$this.prop( 'checked', $( '#in-ect_food_menu-' + $this.val() ).is( ':checked' ) );
|
27 |
+
} );
|
28 |
+
},
|
29 |
+
|
30 |
+
isChecked: function() {
|
31 |
+
return NovaCheckBoxes.inputs.is( ':checked' );
|
32 |
+
},
|
33 |
+
|
34 |
+
checkFirst: function() {
|
35 |
+
NovaCheckBoxes.inputs.first().prop( 'checked', true );
|
36 |
+
},
|
37 |
+
|
38 |
+
checkOne: function( /*event*/ ) {
|
39 |
+
if ( $( this ).is( ':checked' ) ) {
|
40 |
+
return NovaCheckBoxes.inputs.not( this ).prop( 'checked', false );
|
41 |
+
} else {
|
42 |
+
if ( $( this ).closest( '#ect_food_menuchecklist' ).find( ':checked' ).length > 0 ) {
|
43 |
+
return $( this ).prop( 'checked', false );
|
44 |
+
}
|
45 |
+
return NovaCheckBoxes.checkFirst();
|
46 |
+
}
|
47 |
+
}
|
48 |
+
};
|
49 |
+
|
50 |
+
$( NovaCheckBoxes.initialize );
|
51 |
+
})(jQuery);
|
admin/partials/dashboard-display.php
CHANGED
@@ -127,6 +127,30 @@
|
|
127 |
<p>For more information on <strong>How to use Service Shortcodes</strong>, <a href="https://catchthemes.com/blog/essential-content-types-plugin/#Service" title="Essential Content Type: Service Shortcode" target="_blank">Click here</a></p>
|
128 |
</div>
|
129 |
</div><!-- #module-service -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
</div><!-- .module-container -->
|
131 |
</div><!-- .container -->
|
132 |
</div> <!-- #dashboard -->
|
127 |
<p>For more information on <strong>How to use Service Shortcodes</strong>, <a href="https://catchthemes.com/blog/essential-content-types-plugin/#Service" title="Essential Content Type: Service Shortcode" target="_blank">Click here</a></p>
|
128 |
</div>
|
129 |
</div><!-- #module-service -->
|
130 |
+
|
131 |
+
<div id="module-food-menu" class="catch-modules">
|
132 |
+
<?php
|
133 |
+
$food_menu_options = get_option( 'ect_food_menu' );
|
134 |
+
?>
|
135 |
+
<div class="module-header <?php echo $food_menu_options['status'] ? 'active' : 'inactive'; ?>">
|
136 |
+
<h3 class="module-title"><?php esc_html_e( 'Food Menu', 'essential-content-types' ); ?></h3>
|
137 |
+
|
138 |
+
<div class="switch">
|
139 |
+
<input type="checkbox" id="ect_food_menu" class="input-switch" rel="ect_food_menu" <?php checked( true, $food_menu_options['status'] ); ?> >
|
140 |
+
<label for="ect_food_menu"></label>
|
141 |
+
</div>
|
142 |
+
|
143 |
+
<div class="loader"></div>
|
144 |
+
</div>
|
145 |
+
|
146 |
+
<div class="module-content">
|
147 |
+
<p><?php esc_html_e( 'Food Menu – Create and display your Food Menu items on your website.', 'essential-content-types' ); ?></p>
|
148 |
+
|
149 |
+
<p><?php esc_html_e( 'Once enabled, Food Menu Items Post Type options will appear on Dashboard Menu', 'essential-content-types' ); ?></p>
|
150 |
+
|
151 |
+
<p>For more information on <strong>How to use Food Menu Shortcodes</strong>, <a href="https://catchthemes.com/blog/added-food-menu-essential-content-types-plugin-pro-free" title="Essential Content Type: Food Menu Shortcode" target="_blank">Click here</a></p>
|
152 |
+
</div>
|
153 |
+
</div><!-- #module-food-menu -->
|
154 |
</div><!-- .module-container -->
|
155 |
</div><!-- .container -->
|
156 |
</div> <!-- #dashboard -->
|
essential-content-types.php
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
* Plugin Name: Essential Content Types
|
17 |
* Plugin URI: https://catchthemes.com/wp-plugins/essential-content-types/
|
18 |
* Description: Essential Content Types allows you to feature the impressive content through different content/post types on your website just the way you want it. These content/post types are missed by the themes in WordPress Theme Directory as the feature falls more towards the plugins’ territory.
|
19 |
-
* Version: 1.0.
|
20 |
* Author: Catch Themes
|
21 |
* Author URI: https://catchthemes.com
|
22 |
* License: GPL-3.0+
|
16 |
* Plugin Name: Essential Content Types
|
17 |
* Plugin URI: https://catchthemes.com/wp-plugins/essential-content-types/
|
18 |
* Description: Essential Content Types allows you to feature the impressive content through different content/post types on your website just the way you want it. These content/post types are missed by the themes in WordPress Theme Directory as the feature falls more towards the plugins’ territory.
|
19 |
+
* Version: 1.0.9
|
20 |
* Author: Catch Themes
|
21 |
* Author URI: https://catchthemes.com
|
22 |
* License: GPL-3.0+
|
includes/class-essential-content-types-activator.php
CHANGED
@@ -36,7 +36,8 @@ class Essential_Content_Types_Activator {
|
|
36 |
'ect_portfolio',
|
37 |
'ect_testimonial',
|
38 |
'ect_featured_content',
|
39 |
-
'ect_service'
|
|
|
40 |
);
|
41 |
|
42 |
$value = array( 'status' => 1 );
|
36 |
'ect_portfolio',
|
37 |
'ect_testimonial',
|
38 |
'ect_featured_content',
|
39 |
+
'ect_service',
|
40 |
+
'ect_food_menu',
|
41 |
);
|
42 |
|
43 |
$value = array( 'status' => 1 );
|
includes/class-essential-content-types.php
CHANGED
@@ -69,7 +69,7 @@ class Essential_Content_Types {
|
|
69 |
public function __construct() {
|
70 |
|
71 |
$this->plugin_name = 'essential-content-types';
|
72 |
-
$this->version = '1.0.
|
73 |
|
74 |
$this->load_dependencies();
|
75 |
$this->set_locale();
|
69 |
public function __construct() {
|
70 |
|
71 |
$this->plugin_name = 'essential-content-types';
|
72 |
+
$this->version = '1.0.9';
|
73 |
|
74 |
$this->load_dependencies();
|
75 |
$this->set_locale();
|
languages/essential-content-types.pot
CHANGED
@@ -5,7 +5,7 @@ msgid ""
|
|
5 |
msgstr ""
|
6 |
"Project-Id-Version: Essential Content Types\n"
|
7 |
"Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n"
|
8 |
-
"POT-Creation-Date:
|
9 |
"PO-Revision-Date: 2016-12-12 09:23-0500\n"
|
10 |
"Last-Translator: Sakin Shrestha <info@catchthemes.com>\n"
|
11 |
"Language-Team: Catch Themes <info@catchthemes.com>\n"
|
@@ -14,7 +14,7 @@ msgstr ""
|
|
14 |
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
"Content-Transfer-Encoding: 8bit\n"
|
16 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
17 |
-
"X-Generator: Poedit 2.0.
|
18 |
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;esc_attr_e;esc_attr__;_nx;_x;"
|
19 |
"esc_html_e;esc_html__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_n_noop:1,2;"
|
20 |
"__ngettext_noop:1,2;_c,_nc:4c,1,2\n"
|
@@ -22,20 +22,20 @@ msgstr ""
|
|
22 |
"X-Poedit-SourceCharset: UTF-8\n"
|
23 |
"X-Poedit-SearchPath-0: ..\n"
|
24 |
|
25 |
-
#: ../admin/class-essential-content-types-admin.php:
|
26 |
msgid "Settings"
|
27 |
msgstr ""
|
28 |
|
29 |
-
#: ../admin/class-essential-content-types-admin.php:
|
30 |
-
#: ../admin/class-essential-content-types-admin.php:
|
31 |
msgid "Essential Content Types"
|
32 |
msgstr ""
|
33 |
|
34 |
-
#: ../admin/class-essential-content-types-admin.php:
|
35 |
msgid "You do not have sufficient permissions to access this page."
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: ../admin/class-essential-content-types-admin.php:
|
39 |
msgid "Connection Error. Please try again."
|
40 |
msgstr ""
|
41 |
|
@@ -49,6 +49,7 @@ msgstr ""
|
|
49 |
|
50 |
#: ../admin/class-featured-content.php:104
|
51 |
#: ../admin/class-featured-content.php:105
|
|
|
52 |
#: ../admin/partials/dashboard-display.php:84
|
53 |
msgid "Featured Content"
|
54 |
msgstr ""
|
@@ -229,13 +230,15 @@ msgstr ""
|
|
229 |
msgid "Content updated. <a href=\"%s\">View item</a>"
|
230 |
msgstr ""
|
231 |
|
232 |
-
#: ../admin/class-featured-content.php:211 ../admin/class-
|
233 |
-
#: ../admin/class-
|
|
|
234 |
msgid "Custom field updated."
|
235 |
msgstr ""
|
236 |
|
237 |
-
#: ../admin/class-featured-content.php:212 ../admin/class-
|
238 |
-
#: ../admin/class-
|
|
|
239 |
msgid "Custom field deleted."
|
240 |
msgstr ""
|
241 |
|
@@ -270,8 +273,9 @@ msgid ""
|
|
270 |
"\"%2$s\">Preview content</a>"
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: ../admin/class-featured-content.php:221 ../admin/class-
|
274 |
-
#: ../admin/class-
|
|
|
275 |
msgid "M j, Y @ G:i"
|
276 |
msgstr ""
|
277 |
|
@@ -286,48 +290,379 @@ msgstr ""
|
|
286 |
msgid "Content"
|
287 |
msgstr ""
|
288 |
|
289 |
-
#: ../admin/class-featured-content.php:271
|
290 |
-
|
|
|
291 |
msgstr ""
|
292 |
|
293 |
-
#: ../admin/class-featured-content.php:
|
294 |
msgid "Contents"
|
295 |
msgstr ""
|
296 |
|
297 |
-
#: ../admin/class-featured-content.php:
|
298 |
msgid "Featured Content Archive Title"
|
299 |
msgstr ""
|
300 |
|
301 |
-
#: ../admin/class-featured-content.php:
|
302 |
msgid "Featured Content Archive Content"
|
303 |
msgstr ""
|
304 |
|
305 |
-
#: ../admin/class-featured-content.php:
|
306 |
msgid "Featured Content Archive Featured Image"
|
307 |
msgstr ""
|
308 |
|
309 |
-
#: ../admin/class-featured-content.php:
|
310 |
msgid ""
|
311 |
"Your Featured Content Archive currently has no entries. You can start "
|
312 |
"creating them on your dashboard."
|
313 |
msgstr ""
|
314 |
|
315 |
-
#: ../admin/class-featured-content.php:
|
316 |
-
#: ../admin/class-service.php:
|
317 |
msgid "Types"
|
318 |
msgstr ""
|
319 |
|
320 |
-
#: ../admin/class-featured-content.php:
|
321 |
-
#: ../admin/class-service.php:
|
322 |
msgid "Tags"
|
323 |
msgstr ""
|
324 |
|
325 |
-
#: ../admin/class-featured-content.php:
|
326 |
-
#: ../admin/class-service.php:
|
327 |
#, php-format
|
328 |
msgid "<span>Author:</span> <a href=\"%1$s\">%2$s</a>"
|
329 |
msgstr ""
|
330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
msgstr ""
|
@@ -354,7 +689,7 @@ msgstr ""
|
|
354 |
msgid "Portfolio Items"
|
355 |
msgstr ""
|
356 |
|
357 |
-
#: ../admin/class-portfolio.php:230 ../admin/class-portfolio.php:
|
358 |
msgid "Projects"
|
359 |
msgstr ""
|
360 |
|
@@ -362,7 +697,7 @@ msgstr ""
|
|
362 |
msgid "Project"
|
363 |
msgstr ""
|
364 |
|
365 |
-
#: ../admin/class-portfolio.php:232 ../admin/class-portfolio.php:
|
366 |
msgid "Portfolio"
|
367 |
msgstr ""
|
368 |
|
@@ -553,19 +888,19 @@ msgid ""
|
|
553 |
"project</a>"
|
554 |
msgstr ""
|
555 |
|
556 |
-
#: ../admin/class-portfolio.php:
|
557 |
msgid "Portfolio Archive Title"
|
558 |
msgstr ""
|
559 |
|
560 |
-
#: ../admin/class-portfolio.php:
|
561 |
msgid "Portfolio Archive Content"
|
562 |
msgstr ""
|
563 |
|
564 |
-
#: ../admin/class-portfolio.php:
|
565 |
msgid "Portfolio Archive Featured Image"
|
566 |
msgstr ""
|
567 |
|
568 |
-
#: ../admin/class-portfolio.php:
|
569 |
msgid ""
|
570 |
"Your Portfolio Archive currently has no entries. You can start creating "
|
571 |
"them on your dashboard."
|
@@ -576,7 +911,7 @@ msgid "Service Items"
|
|
576 |
msgstr ""
|
577 |
|
578 |
#: ../admin/class-service.php:103 ../admin/class-service.php:276
|
579 |
-
#: ../admin/partials/dashboard-display.php:110
|
580 |
msgid "Services"
|
581 |
msgstr ""
|
582 |
|
@@ -768,31 +1103,27 @@ msgid ""
|
|
768 |
"content</a>"
|
769 |
msgstr ""
|
770 |
|
771 |
-
#: ../admin/class-service.php:
|
772 |
-
msgid "ECT: Service"
|
773 |
-
msgstr ""
|
774 |
-
|
775 |
-
#: ../admin/class-service.php:284
|
776 |
msgid "Service Archive Title"
|
777 |
msgstr ""
|
778 |
|
779 |
-
#: ../admin/class-service.php:
|
780 |
msgid "Service Archive Content"
|
781 |
msgstr ""
|
782 |
|
783 |
-
#: ../admin/class-service.php:
|
784 |
msgid "Service Archive Featured Image"
|
785 |
msgstr ""
|
786 |
|
787 |
-
#: ../admin/class-service.php:
|
788 |
msgid ""
|
789 |
"Your Service Archive currently has no entries. You can start creating them "
|
790 |
"on your dashboard."
|
791 |
msgstr ""
|
792 |
|
793 |
#: ../admin/class-testimonial.php:118 ../admin/class-testimonial.php:263
|
794 |
-
#: ../admin/class-testimonial.php:265 ../admin/class-testimonial.php:
|
795 |
-
#: ../admin/class-testimonial.php:
|
796 |
#: ../admin/partials/dashboard-display.php:59
|
797 |
msgid "Testimonials"
|
798 |
msgstr ""
|
@@ -922,29 +1253,29 @@ msgstr ""
|
|
922 |
msgid "Customize"
|
923 |
msgstr ""
|
924 |
|
925 |
-
#: ../admin/class-testimonial.php:
|
926 |
msgid "Testimonial Archive Title"
|
927 |
msgstr ""
|
928 |
|
929 |
-
#: ../admin/class-testimonial.php:
|
930 |
msgid "Testimonial Archive Content"
|
931 |
msgstr ""
|
932 |
|
933 |
-
#: ../admin/class-testimonial.php:
|
934 |
msgid "Testimonial Archive Featured Image"
|
935 |
msgstr ""
|
936 |
|
937 |
-
#: ../admin/class-testimonial.php:
|
938 |
msgid ""
|
939 |
"Your Testimonial Archive currently has no entries. You can start creating "
|
940 |
"them on your dashboard."
|
941 |
msgstr ""
|
942 |
|
943 |
-
#: ../admin/class-testimonial.php:
|
944 |
msgid "Position"
|
945 |
msgstr ""
|
946 |
|
947 |
-
#: ../admin/class-testimonial.php:
|
948 |
msgid "Testmonial Options"
|
949 |
msgstr ""
|
950 |
|
@@ -1018,6 +1349,20 @@ msgstr ""
|
|
1018 |
msgid "%1$sClick here%2$s to view Service Archive Options."
|
1019 |
msgstr ""
|
1020 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1021 |
#: ../admin/partials/footer.php:22
|
1022 |
msgid "Donate"
|
1023 |
msgstr ""
|
5 |
msgstr ""
|
6 |
"Project-Id-Version: Essential Content Types\n"
|
7 |
"Report-Msgid-Bugs-To: https://wordpress.org/tags/_s\n"
|
8 |
+
"POT-Creation-Date: 2018-03-06 15:03+0545\n"
|
9 |
"PO-Revision-Date: 2016-12-12 09:23-0500\n"
|
10 |
"Last-Translator: Sakin Shrestha <info@catchthemes.com>\n"
|
11 |
"Language-Team: Catch Themes <info@catchthemes.com>\n"
|
14 |
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
"Content-Transfer-Encoding: 8bit\n"
|
16 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
17 |
+
"X-Generator: Poedit 2.0.6\n"
|
18 |
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;esc_attr_e;esc_attr__;_nx;_x;"
|
19 |
"esc_html_e;esc_html__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_n_noop:1,2;"
|
20 |
"__ngettext_noop:1,2;_c,_nc:4c,1,2\n"
|
22 |
"X-Poedit-SourceCharset: UTF-8\n"
|
23 |
"X-Poedit-SearchPath-0: ..\n"
|
24 |
|
25 |
+
#: ../admin/class-essential-content-types-admin.php:176
|
26 |
msgid "Settings"
|
27 |
msgstr ""
|
28 |
|
29 |
+
#: ../admin/class-essential-content-types-admin.php:189
|
30 |
+
#: ../admin/class-essential-content-types-admin.php:190
|
31 |
msgid "Essential Content Types"
|
32 |
msgstr ""
|
33 |
|
34 |
+
#: ../admin/class-essential-content-types-admin.php:204
|
35 |
msgid "You do not have sufficient permissions to access this page."
|
36 |
msgstr ""
|
37 |
|
38 |
+
#: ../admin/class-essential-content-types-admin.php:222
|
39 |
msgid "Connection Error. Please try again."
|
40 |
msgstr ""
|
41 |
|
49 |
|
50 |
#: ../admin/class-featured-content.php:104
|
51 |
#: ../admin/class-featured-content.php:105
|
52 |
+
#: ../admin/class-featured-content.php:276
|
53 |
#: ../admin/partials/dashboard-display.php:84
|
54 |
msgid "Featured Content"
|
55 |
msgstr ""
|
230 |
msgid "Content updated. <a href=\"%s\">View item</a>"
|
231 |
msgstr ""
|
232 |
|
233 |
+
#: ../admin/class-featured-content.php:211 ../admin/class-food-menu.php:269
|
234 |
+
#: ../admin/class-portfolio.php:339 ../admin/class-service.php:211
|
235 |
+
#: ../admin/class-testimonial.php:313
|
236 |
msgid "Custom field updated."
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: ../admin/class-featured-content.php:212 ../admin/class-food-menu.php:270
|
240 |
+
#: ../admin/class-portfolio.php:340 ../admin/class-service.php:212
|
241 |
+
#: ../admin/class-testimonial.php:314
|
242 |
msgid "Custom field deleted."
|
243 |
msgstr ""
|
244 |
|
273 |
"\"%2$s\">Preview content</a>"
|
274 |
msgstr ""
|
275 |
|
276 |
+
#: ../admin/class-featured-content.php:221 ../admin/class-food-menu.php:284
|
277 |
+
#: ../admin/class-portfolio.php:349 ../admin/class-service.php:221
|
278 |
+
#: ../admin/class-testimonial.php:323
|
279 |
msgid "M j, Y @ G:i"
|
280 |
msgstr ""
|
281 |
|
290 |
msgid "Content"
|
291 |
msgstr ""
|
292 |
|
293 |
+
#: ../admin/class-featured-content.php:271 ../admin/class-portfolio.php:405
|
294 |
+
#: ../admin/class-service.php:271 ../admin/class-testimonial.php:429
|
295 |
+
msgid "Essential Content Types Plugin Options"
|
296 |
msgstr ""
|
297 |
|
298 |
+
#: ../admin/class-featured-content.php:281
|
299 |
msgid "Contents"
|
300 |
msgstr ""
|
301 |
|
302 |
+
#: ../admin/class-featured-content.php:289
|
303 |
msgid "Featured Content Archive Title"
|
304 |
msgstr ""
|
305 |
|
306 |
+
#: ../admin/class-featured-content.php:302
|
307 |
msgid "Featured Content Archive Content"
|
308 |
msgstr ""
|
309 |
|
310 |
+
#: ../admin/class-featured-content.php:316
|
311 |
msgid "Featured Content Archive Featured Image"
|
312 |
msgstr ""
|
313 |
|
314 |
+
#: ../admin/class-featured-content.php:560
|
315 |
msgid ""
|
316 |
"Your Featured Content Archive currently has no entries. You can start "
|
317 |
"creating them on your dashboard."
|
318 |
msgstr ""
|
319 |
|
320 |
+
#: ../admin/class-featured-content.php:632 ../admin/class-portfolio.php:767
|
321 |
+
#: ../admin/class-service.php:633
|
322 |
msgid "Types"
|
323 |
msgstr ""
|
324 |
|
325 |
+
#: ../admin/class-featured-content.php:663 ../admin/class-portfolio.php:798
|
326 |
+
#: ../admin/class-service.php:664
|
327 |
msgid "Tags"
|
328 |
msgstr ""
|
329 |
|
330 |
+
#: ../admin/class-featured-content.php:689 ../admin/class-portfolio.php:824
|
331 |
+
#: ../admin/class-service.php:690
|
332 |
#, php-format
|
333 |
msgid "<span>Author:</span> <a href=\"%1$s\">%2$s</a>"
|
334 |
msgstr ""
|
335 |
|
336 |
+
#: ../admin/class-food-menu.php:129
|
337 |
+
msgid "Menu Item Labels"
|
338 |
+
msgstr ""
|
339 |
+
|
340 |
+
#: ../admin/class-food-menu.php:131
|
341 |
+
msgid "Menu Item Label"
|
342 |
+
msgstr ""
|
343 |
+
|
344 |
+
#: ../admin/class-food-menu.php:133
|
345 |
+
msgid "Search Menu Item Labels"
|
346 |
+
msgstr ""
|
347 |
+
|
348 |
+
#: ../admin/class-food-menu.php:134
|
349 |
+
msgid "Popular Labels"
|
350 |
+
msgstr ""
|
351 |
+
|
352 |
+
#: ../admin/class-food-menu.php:136
|
353 |
+
msgid "All Menu Item Labels"
|
354 |
+
msgstr ""
|
355 |
+
|
356 |
+
#: ../admin/class-food-menu.php:138
|
357 |
+
msgid "Edit Menu Item Label"
|
358 |
+
msgstr ""
|
359 |
+
|
360 |
+
#: ../admin/class-food-menu.php:140
|
361 |
+
msgid "View Menu Item Label"
|
362 |
+
msgstr ""
|
363 |
+
|
364 |
+
#: ../admin/class-food-menu.php:142
|
365 |
+
msgid "Update Menu Item Label"
|
366 |
+
msgstr ""
|
367 |
+
|
368 |
+
#: ../admin/class-food-menu.php:144
|
369 |
+
msgid "Add New Menu Item Label"
|
370 |
+
msgstr ""
|
371 |
+
|
372 |
+
#: ../admin/class-food-menu.php:146
|
373 |
+
msgid "New Menu Item Label Name"
|
374 |
+
msgstr ""
|
375 |
+
|
376 |
+
#: ../admin/class-food-menu.php:147
|
377 |
+
msgid "For example, spicy, favorite, etc. <br /> Separate Labels with commas"
|
378 |
+
msgstr ""
|
379 |
+
|
380 |
+
#: ../admin/class-food-menu.php:148
|
381 |
+
msgid "Add or remove Labels"
|
382 |
+
msgstr ""
|
383 |
+
|
384 |
+
#: ../admin/class-food-menu.php:149
|
385 |
+
msgid "Choose from the most used Labels"
|
386 |
+
msgstr ""
|
387 |
+
|
388 |
+
#: ../admin/class-food-menu.php:150
|
389 |
+
msgid "Menu item label list navigation"
|
390 |
+
msgstr ""
|
391 |
+
|
392 |
+
#: ../admin/class-food-menu.php:151
|
393 |
+
msgid "Menu item labels list"
|
394 |
+
msgstr ""
|
395 |
+
|
396 |
+
#: ../admin/class-food-menu.php:153
|
397 |
+
msgid "No Labels found"
|
398 |
+
msgstr ""
|
399 |
+
|
400 |
+
#: ../admin/class-food-menu.php:162
|
401 |
+
msgid "Menu Sections"
|
402 |
+
msgstr ""
|
403 |
+
|
404 |
+
#: ../admin/class-food-menu.php:164
|
405 |
+
msgid "Menu Section"
|
406 |
+
msgstr ""
|
407 |
+
|
408 |
+
#: ../admin/class-food-menu.php:166
|
409 |
+
msgid "Search Menu Sections"
|
410 |
+
msgstr ""
|
411 |
+
|
412 |
+
#: ../admin/class-food-menu.php:168
|
413 |
+
msgid "All Menu Sections"
|
414 |
+
msgstr ""
|
415 |
+
|
416 |
+
#: ../admin/class-food-menu.php:170
|
417 |
+
msgid "Parent Menu Section"
|
418 |
+
msgstr ""
|
419 |
+
|
420 |
+
#: ../admin/class-food-menu.php:172
|
421 |
+
msgid "Parent Menu Section:"
|
422 |
+
msgstr ""
|
423 |
+
|
424 |
+
#: ../admin/class-food-menu.php:174
|
425 |
+
msgid "Edit Menu Section"
|
426 |
+
msgstr ""
|
427 |
+
|
428 |
+
#: ../admin/class-food-menu.php:176
|
429 |
+
msgid "View Menu Section"
|
430 |
+
msgstr ""
|
431 |
+
|
432 |
+
#: ../admin/class-food-menu.php:178
|
433 |
+
msgid "Update Menu Section"
|
434 |
+
msgstr ""
|
435 |
+
|
436 |
+
#: ../admin/class-food-menu.php:180
|
437 |
+
msgid "Add New Menu Section"
|
438 |
+
msgstr ""
|
439 |
+
|
440 |
+
#: ../admin/class-food-menu.php:182
|
441 |
+
msgid "New Menu Sections Name"
|
442 |
+
msgstr ""
|
443 |
+
|
444 |
+
#: ../admin/class-food-menu.php:183
|
445 |
+
msgid "Menu section list navigation"
|
446 |
+
msgstr ""
|
447 |
+
|
448 |
+
#: ../admin/class-food-menu.php:184
|
449 |
+
msgid "Menu section list"
|
450 |
+
msgstr ""
|
451 |
+
|
452 |
+
#: ../admin/class-food-menu.php:204
|
453 |
+
msgid "Items on your restaurant's menu"
|
454 |
+
msgstr ""
|
455 |
+
|
456 |
+
#: ../admin/class-food-menu.php:208 ../admin/class-food-menu.php:214
|
457 |
+
msgid "Menu Items"
|
458 |
+
msgstr ""
|
459 |
+
|
460 |
+
#: ../admin/class-food-menu.php:210
|
461 |
+
msgid "Menu Item"
|
462 |
+
msgstr ""
|
463 |
+
|
464 |
+
#: ../admin/class-food-menu.php:212
|
465 |
+
msgid "Food Menus"
|
466 |
+
msgstr ""
|
467 |
+
|
468 |
+
#: ../admin/class-food-menu.php:216
|
469 |
+
msgid "Add One Item"
|
470 |
+
msgstr ""
|
471 |
+
|
472 |
+
#: ../admin/class-food-menu.php:218
|
473 |
+
msgid "Add Menu Item"
|
474 |
+
msgstr ""
|
475 |
+
|
476 |
+
#: ../admin/class-food-menu.php:220
|
477 |
+
msgid "Edit Menu Item"
|
478 |
+
msgstr ""
|
479 |
+
|
480 |
+
#: ../admin/class-food-menu.php:222
|
481 |
+
msgid "New Menu Item"
|
482 |
+
msgstr ""
|
483 |
+
|
484 |
+
#: ../admin/class-food-menu.php:224
|
485 |
+
msgid "View Menu Item"
|
486 |
+
msgstr ""
|
487 |
+
|
488 |
+
#: ../admin/class-food-menu.php:226
|
489 |
+
msgid "Search Menu Items"
|
490 |
+
msgstr ""
|
491 |
+
|
492 |
+
#: ../admin/class-food-menu.php:228
|
493 |
+
msgid "No Menu Items found"
|
494 |
+
msgstr ""
|
495 |
+
|
496 |
+
#: ../admin/class-food-menu.php:230
|
497 |
+
msgid "No Menu Items found in Trash"
|
498 |
+
msgstr ""
|
499 |
+
|
500 |
+
#: ../admin/class-food-menu.php:231
|
501 |
+
msgid "Filter menu items list"
|
502 |
+
msgstr ""
|
503 |
+
|
504 |
+
#: ../admin/class-food-menu.php:232
|
505 |
+
msgid "Menu item list navigation"
|
506 |
+
msgstr ""
|
507 |
+
|
508 |
+
#: ../admin/class-food-menu.php:233
|
509 |
+
msgid "Menu items list"
|
510 |
+
msgstr ""
|
511 |
+
|
512 |
+
#: ../admin/class-food-menu.php:268
|
513 |
+
#, php-format
|
514 |
+
msgid "Menu item updated. <a href=\"%s\">View item</a>"
|
515 |
+
msgstr ""
|
516 |
+
|
517 |
+
#: ../admin/class-food-menu.php:272
|
518 |
+
msgid "Menu item updated."
|
519 |
+
msgstr ""
|
520 |
+
|
521 |
+
#: ../admin/class-food-menu.php:274
|
522 |
+
#, php-format
|
523 |
+
msgid "Menu item restored to revision from %s"
|
524 |
+
msgstr ""
|
525 |
+
|
526 |
+
#: ../admin/class-food-menu.php:276
|
527 |
+
#, php-format
|
528 |
+
msgid "Menu item published. <a href=\"%s\">View item</a>"
|
529 |
+
msgstr ""
|
530 |
+
|
531 |
+
#: ../admin/class-food-menu.php:278
|
532 |
+
msgid "Menu item saved."
|
533 |
+
msgstr ""
|
534 |
+
|
535 |
+
#: ../admin/class-food-menu.php:280
|
536 |
+
#, php-format
|
537 |
+
msgid "Menu item submitted. <a target=\"_blank\" href=\"%s\">Preview item</a>"
|
538 |
+
msgstr ""
|
539 |
+
|
540 |
+
#: ../admin/class-food-menu.php:282
|
541 |
+
#, php-format
|
542 |
+
msgid ""
|
543 |
+
"Menu item scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" href="
|
544 |
+
"\"%2$s\">Preview item</a>"
|
545 |
+
msgstr ""
|
546 |
+
|
547 |
+
#: ../admin/class-food-menu.php:286
|
548 |
+
#, php-format
|
549 |
+
msgid ""
|
550 |
+
"Menu item draft updated. <a target=\"_blank\" href=\"%s\">Preview item</a>"
|
551 |
+
msgstr ""
|
552 |
+
|
553 |
+
#: ../admin/class-food-menu.php:316
|
554 |
+
msgid "Enter the menu item's name here"
|
555 |
+
msgstr ""
|
556 |
+
|
557 |
+
#: ../admin/class-food-menu.php:331 ../admin/class-food-menu.php:336
|
558 |
+
#, php-format
|
559 |
+
msgid "%1$d Food Menu Item"
|
560 |
+
msgid_plural "%1$d Food Menu Items"
|
561 |
+
msgstr[0] ""
|
562 |
+
msgstr[1] ""
|
563 |
+
|
564 |
+
#: ../admin/class-food-menu.php:422 ../admin/class-food-menu.php:423
|
565 |
+
#: ../admin/class-food-menu.php:929
|
566 |
+
msgid "Add Many Items"
|
567 |
+
msgstr ""
|
568 |
+
|
569 |
+
#: ../admin/class-food-menu.php:482
|
570 |
+
msgid "Menu Items re-ordered."
|
571 |
+
msgstr ""
|
572 |
+
|
573 |
+
#: ../admin/class-food-menu.php:501
|
574 |
+
msgid "Thumbnail"
|
575 |
+
msgstr ""
|
576 |
+
|
577 |
+
#: ../admin/class-food-menu.php:502
|
578 |
+
msgid "Labels"
|
579 |
+
msgstr ""
|
580 |
+
|
581 |
+
#: ../admin/class-food-menu.php:503 ../admin/class-food-menu.php:946
|
582 |
+
#: ../admin/class-food-menu.php:991 ../admin/class-food-menu.php:997
|
583 |
+
msgid "Price"
|
584 |
+
msgstr ""
|
585 |
+
|
586 |
+
#: ../admin/class-food-menu.php:504
|
587 |
+
msgid "Order"
|
588 |
+
msgstr ""
|
589 |
+
|
590 |
+
#: ../admin/class-food-menu.php:570 ../admin/class-food-menu.php:628
|
591 |
+
msgid "Save New Order"
|
592 |
+
msgstr ""
|
593 |
+
|
594 |
+
#: ../admin/class-food-menu.php:831
|
595 |
+
msgid "edit"
|
596 |
+
msgstr ""
|
597 |
+
|
598 |
+
#: ../admin/class-food-menu.php:834
|
599 |
+
msgid "Uncategorized"
|
600 |
+
msgstr ""
|
601 |
+
|
602 |
+
#: ../admin/class-food-menu.php:840
|
603 |
+
msgid "Move menu section up"
|
604 |
+
msgstr ""
|
605 |
+
|
606 |
+
#: ../admin/class-food-menu.php:840
|
607 |
+
msgid "UP"
|
608 |
+
msgstr ""
|
609 |
+
|
610 |
+
#: ../admin/class-food-menu.php:842
|
611 |
+
msgid "Move menu section down"
|
612 |
+
msgstr ""
|
613 |
+
|
614 |
+
#: ../admin/class-food-menu.php:842
|
615 |
+
msgid "DOWN"
|
616 |
+
msgstr ""
|
617 |
+
|
618 |
+
#: ../admin/class-food-menu.php:931
|
619 |
+
msgid ""
|
620 |
+
"Use the <kbd>TAB</kbd> key on your keyboard to move between colums and the "
|
621 |
+
"<kbd>ENTER</kbd> or <kbd>RETURN</kbd> key to save each row and move on to "
|
622 |
+
"the next."
|
623 |
+
msgstr ""
|
624 |
+
|
625 |
+
#: ../admin/class-food-menu.php:934
|
626 |
+
msgid "Add to section:"
|
627 |
+
msgstr ""
|
628 |
+
|
629 |
+
#: ../admin/class-food-menu.php:945
|
630 |
+
msgid "Name"
|
631 |
+
msgstr ""
|
632 |
+
|
633 |
+
#: ../admin/class-food-menu.php:947
|
634 |
+
msgid ""
|
635 |
+
"Labels: <small>spicy, favorite, etc. <em>Separate Labels with commas</em></"
|
636 |
+
"small>"
|
637 |
+
msgstr ""
|
638 |
+
|
639 |
+
#: ../admin/class-food-menu.php:948
|
640 |
+
msgid "Description"
|
641 |
+
msgstr ""
|
642 |
+
|
643 |
+
#: ../admin/class-food-menu.php:969
|
644 |
+
msgid "New Row"
|
645 |
+
msgstr ""
|
646 |
+
|
647 |
+
#: ../admin/class-food-menu.php:978
|
648 |
+
msgid "Add These New Menu Items"
|
649 |
+
msgstr ""
|
650 |
+
|
651 |
+
#: ../admin/class-food-menu.php:1065 ../admin/class-food-menu.php:1084
|
652 |
+
msgctxt "Nova label separator"
|
653 |
+
msgid ", "
|
654 |
+
msgstr ""
|
655 |
+
|
656 |
+
#: ../admin/class-food-menu.php:1086
|
657 |
+
msgid "No Labels"
|
658 |
+
msgstr ""
|
659 |
+
|
660 |
+
#: ../admin/class-food-menu.php:1436
|
661 |
+
msgid ""
|
662 |
+
"Your Food Menu Archive currently has no entries. You can start creating "
|
663 |
+
"them on your dashboard."
|
664 |
+
msgstr ""
|
665 |
+
|
666 |
#: ../admin/class-portfolio.php:97
|
667 |
msgid "Portfolio Projects"
|
668 |
msgstr ""
|
689 |
msgid "Portfolio Items"
|
690 |
msgstr ""
|
691 |
|
692 |
+
#: ../admin/class-portfolio.php:230 ../admin/class-portfolio.php:418
|
693 |
msgid "Projects"
|
694 |
msgstr ""
|
695 |
|
697 |
msgid "Project"
|
698 |
msgstr ""
|
699 |
|
700 |
+
#: ../admin/class-portfolio.php:232 ../admin/class-portfolio.php:410
|
701 |
msgid "Portfolio"
|
702 |
msgstr ""
|
703 |
|
888 |
"project</a>"
|
889 |
msgstr ""
|
890 |
|
891 |
+
#: ../admin/class-portfolio.php:426
|
892 |
msgid "Portfolio Archive Title"
|
893 |
msgstr ""
|
894 |
|
895 |
+
#: ../admin/class-portfolio.php:441
|
896 |
msgid "Portfolio Archive Content"
|
897 |
msgstr ""
|
898 |
|
899 |
+
#: ../admin/class-portfolio.php:457
|
900 |
msgid "Portfolio Archive Featured Image"
|
901 |
msgstr ""
|
902 |
|
903 |
+
#: ../admin/class-portfolio.php:695
|
904 |
msgid ""
|
905 |
"Your Portfolio Archive currently has no entries. You can start creating "
|
906 |
"them on your dashboard."
|
911 |
msgstr ""
|
912 |
|
913 |
#: ../admin/class-service.php:103 ../admin/class-service.php:276
|
914 |
+
#: ../admin/class-service.php:282 ../admin/partials/dashboard-display.php:110
|
915 |
msgid "Services"
|
916 |
msgstr ""
|
917 |
|
1103 |
"content</a>"
|
1104 |
msgstr ""
|
1105 |
|
1106 |
+
#: ../admin/class-service.php:290
|
|
|
|
|
|
|
|
|
1107 |
msgid "Service Archive Title"
|
1108 |
msgstr ""
|
1109 |
|
1110 |
+
#: ../admin/class-service.php:303
|
1111 |
msgid "Service Archive Content"
|
1112 |
msgstr ""
|
1113 |
|
1114 |
+
#: ../admin/class-service.php:317
|
1115 |
msgid "Service Archive Featured Image"
|
1116 |
msgstr ""
|
1117 |
|
1118 |
+
#: ../admin/class-service.php:561
|
1119 |
msgid ""
|
1120 |
"Your Service Archive currently has no entries. You can start creating them "
|
1121 |
"on your dashboard."
|
1122 |
msgstr ""
|
1123 |
|
1124 |
#: ../admin/class-testimonial.php:118 ../admin/class-testimonial.php:263
|
1125 |
+
#: ../admin/class-testimonial.php:265 ../admin/class-testimonial.php:434
|
1126 |
+
#: ../admin/class-testimonial.php:441
|
1127 |
#: ../admin/partials/dashboard-display.php:59
|
1128 |
msgid "Testimonials"
|
1129 |
msgstr ""
|
1253 |
msgid "Customize"
|
1254 |
msgstr ""
|
1255 |
|
1256 |
+
#: ../admin/class-testimonial.php:447
|
1257 |
msgid "Testimonial Archive Title"
|
1258 |
msgstr ""
|
1259 |
|
1260 |
+
#: ../admin/class-testimonial.php:459
|
1261 |
msgid "Testimonial Archive Content"
|
1262 |
msgstr ""
|
1263 |
|
1264 |
+
#: ../admin/class-testimonial.php:470
|
1265 |
msgid "Testimonial Archive Featured Image"
|
1266 |
msgstr ""
|
1267 |
|
1268 |
+
#: ../admin/class-testimonial.php:623
|
1269 |
msgid ""
|
1270 |
"Your Testimonial Archive currently has no entries. You can start creating "
|
1271 |
"them on your dashboard."
|
1272 |
msgstr ""
|
1273 |
|
1274 |
+
#: ../admin/class-testimonial.php:813
|
1275 |
msgid "Position"
|
1276 |
msgstr ""
|
1277 |
|
1278 |
+
#: ../admin/class-testimonial.php:854
|
1279 |
msgid "Testmonial Options"
|
1280 |
msgstr ""
|
1281 |
|
1349 |
msgid "%1$sClick here%2$s to view Service Archive Options."
|
1350 |
msgstr ""
|
1351 |
|
1352 |
+
#: ../admin/partials/dashboard-display.php:136
|
1353 |
+
msgid "Food Menu"
|
1354 |
+
msgstr ""
|
1355 |
+
|
1356 |
+
#: ../admin/partials/dashboard-display.php:147
|
1357 |
+
msgid "Food Menu – Create and display your Food Menu items on your website."
|
1358 |
+
msgstr ""
|
1359 |
+
|
1360 |
+
#: ../admin/partials/dashboard-display.php:149
|
1361 |
+
msgid ""
|
1362 |
+
"Once enabled, Food Menu Items Post Type options will appear on Dashboard "
|
1363 |
+
"Menu"
|
1364 |
+
msgstr ""
|
1365 |
+
|
1366 |
#: ../admin/partials/footer.php:22
|
1367 |
msgid "Donate"
|
1368 |
msgstr ""
|