From 6f51ed3425196e5bc5cfaa15804685a6274780a7 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Sat, 29 Aug 2015 05:07:50 +1000 Subject: [PATCH] Add custom title to inserted shortcodes --- includes/class-sp-ajax.php | 73 +++++++++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 12 deletions(-) diff --git a/includes/class-sp-ajax.php b/includes/class-sp-ajax.php index 0bbafd9c..5e21316b 100644 --- a/includes/class-sp-ajax.php +++ b/includes/class-sp-ajax.php @@ -80,8 +80,9 @@ class SP_AJAX {

+

- +

@@ -109,8 +110,9 @@ class SP_AJAX { ?>

+

- +

@@ -138,8 +140,9 @@ class SP_AJAX { ?>

+

- +

@@ -167,8 +170,9 @@ class SP_AJAX { ?>

+

- +

@@ -215,8 +219,9 @@ class SP_AJAX {

+

- +

@@ -231,6 +236,12 @@ class SP_AJAX { public function event_list_shortcode() { ?>
+

+ +

+

- +

@@ -322,6 +334,12 @@ class SP_AJAX { public function event_blocks_shortcode() { ?>
+

+ +

+

- +

@@ -396,6 +415,12 @@ class SP_AJAX { public function table_table_shortcode() { ?>
+

+ +

+

- +

@@ -475,8 +501,9 @@ class SP_AJAX { ?>

+

- +

@@ -504,8 +531,9 @@ class SP_AJAX { ?>

+

- +

@@ -520,6 +548,12 @@ class SP_AJAX { public function player_list_shortcode() { ?>
+

+ +

+

- +

@@ -610,6 +645,12 @@ class SP_AJAX { public function player_gallery_shortcode() { ?> @@ -702,6 +744,7 @@ class SP_AJAX { args.status = $div.find('[name=status]').val(); args.show_all_events_link = $div.find('[name=show_all_events_link]:checked').length; } else if ( 'event_list' == type ) { + args.title = $div.find('[name=title]').val(); args.status = $div.find('[name=status]').val(); args.date = $div.find('[name=date]').val(); args.number = $div.find('[name=number]').val(); @@ -709,23 +752,27 @@ class SP_AJAX { args.columns = $div.find('[name="columns[]"]:checked').map(function() { return this.value; }).get().join(','); args.show_all_events_link = $div.find('[name=show_all_events_link]:checked').length; } else if ( 'event_blocks' == type ) { + args.title = $div.find('[name=title]').val(); args.status = $div.find('[name=status]').val(); args.date = $div.find('[name=date]').val(); args.number = $div.find('[name=number]').val(); args.order = $div.find('[name=order]').val(); args.show_all_events_link = $div.find('[name=show_all_events_link]:checked').length; } else if ( 'league_table' == type ) { + args.title = $div.find('[name=title]').val(); args.number = $div.find('[name=number]').val(); args.columns = $div.find('[name="columns[]"]:checked').map(function() { return this.value; }).get().join(','); args.show_team_logo = $div.find('[name=show_team_logo]:checked').length; args.show_full_table_link = $div.find('[name=show_full_table_link]:checked').length; } else if ( 'player_list' == type ) { + args.title = $div.find('[name=title]').val(); args.number = $div.find('[name=number]').val(); args.columns = $div.find('[name="columns[]"]:checked').map(function() { return this.value; }).get().join(','); args.orderby = $div.find('[name=orderby]').val(); args.order = $div.find('[name=order]').val(); args.show_all_players_link = $div.find('[name=show_all_players_link]:checked').length; } else if ( 'player_gallery' == type ) { + args.title = $div.find('[name=title]').val(); args.number = $div.find('[name=number]').val(); args.orderby = $div.find('[name=orderby]').val(); args.order = $div.find('[name=order]').val(); @@ -733,6 +780,8 @@ class SP_AJAX { args.show_names_on_hover = $div.find('[name=show_names_on_hover]:checked').length; } + + // Generate the shortcode var shortcode = '[' + type; for ( var key in args ) {