コード例 #1
0
ファイル: main.php プロジェクト: proudchild/sdmblog
function fa_tinymce_plugin($plugin_array)
{
    $plugin_array['fa_shortcode'] = FA_path('scripts/admin/tinymce/admin_tinymce_shortcode.js');
    return $plugin_array;
}
コード例 #2
0
ファイル: pages-list.php プロジェクト: proudchild/sdmblog
$columns = array('cb' => '', 'post_title_lbl' => __('Title', 'falite'), 'post_author' => __('Author', 'falite'), 'post_date' => __('Date', 'falite'));
$pages_table->columns = $columns;
$pages_table->per_page = 13;
// set sortable columns
$sortable_columns = array('post_title_lbl' => array('post_title', true), 'post_author' => array('post_author', false), 'post_date' => array('post_date', false));
// set delete and edit pages
$pages_table->edit_page = '#';
$pages_table->bulk_actions = false;
$pages_table->sortable_columns = $sortable_columns;
$pages_table->post_type = 'page';
// get the records from DB
$pages_table->prepare_items();
// styling and scripts
// styling and scripts
wp_enqueue_style('FA_add_content', FA_path('styles/add_content_modal.css'));
wp_enqueue_script('FA_content_add_script', FA_path('scripts/admin/display_control_modal.js'), array('jquery'));
// output iframe header
iframe_header(__('Pages', 'falite'));
?>
<div class="wrap">
	<div class="icon32 icon32-posts-page" id="icon-edit"><br></div>
    <h2><?php 
_e('Select pages', 'falite');
?>
</h2>
    <?php 
$pages_table->display();
?>
    <input class="button-primary" value="<?php 
_e('Close window', '');
?>
コード例 #3
0
ファイル: sliders-list.php プロジェクト: rajankz/webspace
$sliders_table = new FA_List_Table(array('singular' => 'slider', 'plural' => 'sliders'));
// set columns to be displayed
$columns = array('post_title_s' => __('Title', 'falite'), 'ID' => __('Slider ID', 'falite'), 'slider_content' => __('Content', 'falite'), 'slider_theme' => __('Slider theme', 'falite'));
$sliders_table->columns = $columns;
$sliders_table->per_page = 13;
// set sortable columns
$sortable_columns = array('post_title' => array('post_title', false), 'post_author' => array('post_author', false), 'post_date' => array('post_date', true));
// set delete and edit pages
$sliders_table->edit_page = 'featured-articles-pro';
$sliders_table->bulk_actions = false;
$sliders_table->sortable_columns = $sortable_columns;
// get the records from DB
$sliders_table->prepare_items('fa_slider');
// styling and scripts
wp_enqueue_style('FA_add_content', FA_path('styles/add_content_modal.css'));
wp_enqueue_script('FA_sliders_shortcode', FA_path('scripts/admin/admin_shortcode.js'), array('jquery'));
// output iframe header
iframe_header(__('Slideshows', 'falite'));
?>
<div class="wrap">
	<div class="icon32 icon32-posts-page" id="icon-edit"><br></div>
    <h2><?php 
_e('Select slideshow', 'falite');
?>
</h2>
    <?php 
$sliders_table->display();
?>
</div>
<?php 
// output iframe footer
コード例 #4
0
ファイル: common.php プロジェクト: rajankz/webspace
/**
 * FA themes folder can be changed from plugin administration. This solves the problem with the themes being deleted on plugin update.
 * Theme folder must be located inside wp content folder, where default plugins and themes folders from Wordpress are.
 * 
 * Use either FA_themes_path() or FA_themes_url() to retrieve folder path information.
 * 
 * @param bool $full_path -  return a full path (true) or just the path from inside wp content folder(false)
 * @param bool $echo - return the path (false) or echo it(true)
 * @param bool $return_url - return url instead of path
 * @return path to FA themes folder
 * 
 * @since 2.4.1
 */
function FA_get_themes_folder($full_path = true, $echo = false, $return_url = false)
{
    // plugin option set on activation.
    $plugin_options = get_option('fa_plugin_details', array());
    // if themes folder path is in plugin options, let's use it
    if (array_key_exists('themes_folder', $plugin_options)) {
        // small problem with themes folder settings being set wrong. Correct it if it's the case.
        if (strstr($plugin_options['themes_folder'], 'featured-articles-pro')) {
            $plugin_options['themes_folder'] = str_replace('featured-articles-pro', 'featured-articles-lite', $plugin_options['themes_folder']);
        }
        if (!$full_path) {
            $path = $plugin_options['themes_folder'];
        } else {
            $path = ($return_url ? WP_CONTENT_URL : WP_CONTENT_DIR) . '/' . $plugin_options['themes_folder'];
        }
    } else {
        // the default path is inside plugin folder
        $path = $return_url ? FA_path('themes') : FA_dir('themes');
        if (!$full_path) {
            $remove = $return_url ? WP_CONTENT_URL : WP_CONTENT_DIR;
            $path = str_replace($remove . '/', '', $path);
        }
    }
    if ($echo) {
        echo $path;
    } else {
        return $path;
    }
}