-
Anonymous
Как я могу изменить плагин_dir_url на другую папку?
Сообщение
Anonymous »
У меня есть плагин WordPress для шоркодов. Я пытаюсь реализовать это в своей теме без необходимости ее установки.
Как я могу изменить эти 2 строки кода, где написано «plugin_dir_url», чтобы захватывает файлы из папки моего шаблона?
Код: Выделить всё
class SYMPLE_TinyMCE_Buttons {
function __construct() {
add_action( 'init', array(&$this,'init') );
}
function init() {
if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
return;
if ( get_user_option('rich_editing') == 'true' ) {
add_filter( 'mce_external_plugins', array(&$this, 'add_plugin') );
add_filter( 'mce_buttons', array(&$this,'register_button') );
**wp_localize_script( 'jquery', 'sympleShortcodesVars', array('template_url' => plugin_dir_url( __FILE__ ) ) );**
}
}
function add_plugin($plugin_array) {
**$plugin_array['symple_shortcodes'] = plugin_dir_url( __FILE__ ) .'js/symple_shortcodes_tinymce.js';**
return $plugin_array;
}
function register_button($buttons) {
array_push($buttons, "symple_shortcodes_button");
return $buttons;
}
большое спасибо.
Подробнее здесь:
https://stackoverflow.com/questions/136 ... her-folder
1733189436
Anonymous
У меня есть плагин WordPress для шоркодов. Я пытаюсь реализовать это в своей теме без необходимости ее установки.
Как я могу изменить эти 2 строки кода, где написано «plugin_dir_url», чтобы захватывает файлы из папки моего шаблона?
[code]class SYMPLE_TinyMCE_Buttons {
function __construct() {
add_action( 'init', array(&$this,'init') );
}
function init() {
if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
return;
if ( get_user_option('rich_editing') == 'true' ) {
add_filter( 'mce_external_plugins', array(&$this, 'add_plugin') );
add_filter( 'mce_buttons', array(&$this,'register_button') );
**wp_localize_script( 'jquery', 'sympleShortcodesVars', array('template_url' => plugin_dir_url( __FILE__ ) ) );**
}
}
function add_plugin($plugin_array) {
**$plugin_array['symple_shortcodes'] = plugin_dir_url( __FILE__ ) .'js/symple_shortcodes_tinymce.js';**
return $plugin_array;
}
function register_button($buttons) {
array_push($buttons, "symple_shortcodes_button");
return $buttons;
}
[/code]
большое спасибо.
Подробнее здесь: [url]https://stackoverflow.com/questions/13695513/how-can-i-change-plugin-dir-url-to-another-folder[/url]