post_author)) return $content; $poster = new WP_User($post->post_author); if (!$poster->has_cap(EXECPHP_CAPABILITY)) return $content; // to be compatible with older PHP4 installations // don't use fancy ob_XXX shortcut functions ob_start(); eval(" ?>$contentrole_objects as $role) { if ($role->has_cap(EXECPHP_CAPABILITY)) return; } // be sure standard roles are available, these may be deleted or // renamed by the blog administrator $role = get_role('administrator'); if ($role !== NULL) $role->add_cap(EXECPHP_CAPABILITY); $role = get_role('editor'); if ($role !== NULL) $role->add_cap(EXECPHP_CAPABILITY); } function execphp_install() { // not needed anymore delete_option(EXECPHP_OPTION_HAS_OLD_STYLE); delete_option(EXECPHP_OPTION_IGNORE_OLD_STYLE_WARNING); execphp_install_capability(); } function execphp_init() { add_filter('admin_menu', 'execphp_install'); add_filter('the_content', 'execphp_eval_php', 1); add_filter('the_content_rss', 'execphp_eval_php', 1); add_filter('the_excerpt', 'execphp_eval_php', 1); add_filter('the_excerpt_rss', 'execphp_eval_php', 1); } // -------------------------------------------------------------------------- // activate plugin // -------------------------------------------------------------------------- global $wp_version; if (substr($wp_version, 0, 2) == "1.") _e("This version of Exec-PHP does not support Wordpress 1.x anymore", EXECPHP_PLUGIN_ID); else add_filter('init', 'execphp_init'); ?>