File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
classes/Visualizer/Module Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -606,6 +606,22 @@ private function _handleDataAndSettingsPage() {
606
606
// save meta data only when it is NOT being canceled.
607
607
if ( ! ( isset ( $ _POST ['cancel ' ] ) && 1 === intval ( $ _POST ['cancel ' ] ) ) ) {
608
608
update_post_meta ( $ this ->_chart ->ID , Visualizer_Plugin::CF_SETTINGS , $ _POST );
609
+
610
+ // we will keep a parameter called 'internal_title' that will be set to the given title or, if empty, the chart ID
611
+ // this will help in searching with the chart id.
612
+ $ settings = get_post_meta ( $ this ->_chart ->ID , Visualizer_Plugin::CF_SETTINGS , true );
613
+ $ title = null ;
614
+ if ( isset ( $ settings ['title ' ] ) && ! empty ( $ settings ['title ' ] ) ) {
615
+ $ title = $ settings ['title ' ];
616
+ if ( is_array ( $ title ) ) {
617
+ $ title = $ settings ['title ' ]['text ' ];
618
+ }
619
+ }
620
+ if ( empty ( $ title ) ) {
621
+ $ title = $ this ->_chart ->ID ;
622
+ }
623
+ $ settings ['internal_title ' ] = $ title ;
624
+ update_post_meta ( $ this ->_chart ->ID , Visualizer_Plugin::CF_SETTINGS , $ settings );
609
625
}
610
626
$ render = new Visualizer_Render_Page_Send ();
611
627
$ render ->text = sprintf ( '[visualizer id="%d"] ' , $ this ->_chart ->ID );
You can’t perform that action at this time.
0 commit comments