Beispiel #1
0
    public function create_admin_page()
    {
        // Set class property
        $this->options = get_option('slickc_settings');
        if (!$this->options) {
            slickc_set_options();
            $this->options = get_option('slickc_settings');
        }
        ?>
		<div class="wrap">
		<h2>Slick Carousel <?php 
        _e('Settings', 'slick-carousel');
        ?>
</h2>
		<p><?php 
        printf(__('You can set the default behaviour of your carousels here.'));
        ?>
</p>
					 
				<form method="post" action="options.php">
				<?php 
        settings_fields('slickc_settings');
        do_settings_sections('slick-carousel');
        submit_button();
        ?>
				</form>
		</div>
		<?php 
    }
Beispiel #2
0
function slickc_shortcode($attributes, $content = null)
{
    // Set default shortcode attributes
    $options = get_option('slickc_settings');
    if (!$options) {
        slickc_set_options();
        $options = get_option('slickc_settings');
    }
    $options['id'] = '';
    // Parse incomming $attributes into an array and merge it with $defaults
    $attributes = shortcode_atts($options, $attributes);
    return slickc_frontend($attributes);
}