PluginProbe
Code Embed / 1.6.1
Code Embed v1.6.1
2.6.4 2.6.3 2.6.2 2.6.1 trunk 1.0 1.1 1.2 1.3 1.4.1 1.5.1 1.6.1 2.0.2 2.1.2 2.2.2 2.3.9 2.4 2.5.1 2.5.2 2.6
simple-embed-code / includes / get-options.php

get-options.php in Code Embed 1.6.1, at includes/get-options.php

40 lines 967 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Get Code Embed Parameters
4 *
5 * Fetch options - if none exist set them. If the old options exist, move them over
6 *
7 * @package Artiss-Code-Embed
8 * @since 1.5
9 *
10 * @return string Array of default options
11 */
12
13 function ace_get_embed_paras() {
14
15 $options = get_option( 'artiss_code_embed' );
16 $changed = false;
17
18 // If array doesn't exist, set defaults
19
20 if ( !is_array( $options ) ) {
21 $options = array( 'opening_ident' => '%', 'keyword_ident' => 'CODE', 'closing_ident' => '%' );
22 $changed = true;
23 }
24
25 // If the old options exist, import and delete them
26
27 if ( get_option( 'simple_code_embed' ) ) {
28 $old_option = get_option( 'simple_code_embed' );
29 $options[ 'keyword_ident' ] = $old_option[ 'prefix'];
30 delete_option( 'simple_code_embed' );
31 $changed = true;
32 }
33
34 // Update the options, if changed, and return the result
35
36 if ( $changed ) { update_option( 'artiss_code_embed', $options );}
37
38 return $options;
39 }
40 ?>