Adaptation to work with wp-otherguise
This commit is contained in:
parent
63cbe3b54d
commit
e6d0bbe2a1
|
|
@ -21,6 +21,24 @@ return array(
|
|||
'editorStyle' => 'file:./index.css',
|
||||
'style' => 'file:./style-index.css',
|
||||
'render' => 'file:./render.php',
|
||||
'viewScript' => 'file:./view.js'
|
||||
'viewScript' => 'file:./view.js',
|
||||
'attributes' => array(
|
||||
'mapHeight' => array(
|
||||
'type' => 'string',
|
||||
'default' => ''
|
||||
),
|
||||
'graphHeight' => array(
|
||||
'type' => 'string',
|
||||
'default' => ''
|
||||
),
|
||||
'showAttachments' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => true
|
||||
),
|
||||
'showDownload' => array(
|
||||
'type' => 'boolean',
|
||||
'default' => true
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -16,5 +16,23 @@
|
|||
"editorStyle": "file:./index.css",
|
||||
"style": "file:./style-index.css",
|
||||
"render": "file:./render.php",
|
||||
"viewScript": "file:./view.js"
|
||||
"viewScript": "file:./view.js",
|
||||
"attributes": {
|
||||
"mapHeight": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"graphHeight": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"showAttachments": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"showDownload": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,7 +8,10 @@
|
|||
$gpxes = get_attached_media('application/gpx+xml');
|
||||
foreach ($gpxes as $id => $gpx) {
|
||||
$url = wp_get_attachment_url($id);
|
||||
$parameters = ['gpx'=>$url, 'attachments'=>true];
|
||||
$parameters = array( 'gpx' => $url, 'attachments' => empty( $attributes['showAttachments'] ) ? 'false' : true );
|
||||
if ( ! empty( $attributes['mapHeight'] ) ) { $parameters['mheight'] = $attributes['mapHeight']; }
|
||||
if ( ! empty( $attributes['graphHeight'] ) ) { $parameters['gheight'] = $attributes['graphHeight']; }
|
||||
if ( empty( $attributes['showDownload'] ) ) { $parameters['download'] = 'false'; }
|
||||
|
||||
echo '<div class="attached-gpx">'.
|
||||
wpgpxmaps_handle_shortcodes(
|
||||
|
|
|
|||
|
|
@ -16,5 +16,11 @@
|
|||
"editorStyle": "file:./index.css",
|
||||
"style": "file:./style-index.css",
|
||||
"render": "file:./render.php",
|
||||
"viewScript": "file:./view.js"
|
||||
"viewScript": "file:./view.js",
|
||||
"attributes": {
|
||||
"mapHeight": { "type": "string", "default": "" },
|
||||
"graphHeight": { "type": "string", "default": "" },
|
||||
"showAttachments": { "type": "boolean", "default": true },
|
||||
"showDownload": { "type": "boolean", "default": true }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,10 @@
|
|||
$gpxes = get_attached_media('application/gpx+xml');
|
||||
foreach ($gpxes as $id => $gpx) {
|
||||
$url = wp_get_attachment_url($id);
|
||||
$parameters = ['gpx'=>$url, 'attachments'=>true];
|
||||
$parameters = array( 'gpx' => $url, 'attachments' => empty( $attributes['showAttachments'] ) ? 'false' : true );
|
||||
if ( ! empty( $attributes['mapHeight'] ) ) { $parameters['mheight'] = $attributes['mapHeight']; }
|
||||
if ( ! empty( $attributes['graphHeight'] ) ) { $parameters['gheight'] = $attributes['graphHeight']; }
|
||||
if ( empty( $attributes['showDownload'] ) ) { $parameters['download'] = 'false'; }
|
||||
|
||||
echo '<div class="attached-gpx">'.
|
||||
wpgpxmaps_handle_shortcodes(
|
||||
|
|
|
|||
Loading…
Reference in New Issue