如何在我自己的插件中包含wordpress计划功能?

时间:2012-01-23 20:27:04

标签: php wordpress wordpress-plugin

我的插件包含自定义内容textarea,我想添加wordpress帖子所具有的相同日程安排功能。

有一些简单的程序吗?

enter image description here

1 个答案:

答案 0 :(得分:0)

HTML:

<div class="misc-pub-section curtime misc-pub-section-last">
    <?php
    $datef = __('M j, Y @ G:i');
    $stamp = __('Publish <b>immediately</b>');
    $date = date_i18n($datef, strtotime(current_time('mysql')));
    ?>                              
    <span id="timestamp"><?php printf($stamp, $date); ?></span>
    <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
    <div id="timestampdiv" class="hide-if-js"><?php touch_time(0, 0, 5); ?></div>
</div>

PHP:

add_action('admin_print_scripts', 'header_scripts');

function header_scripts()
{
    wp_enqueue_script('nomikos_my_plugin_js_comment', site_url('wp-admin/js/comment.js'));
}