Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter asherber

    (@asherber)

    Thanks very much! I can confirm that this is working for me now.

    Thread Starter asherber

    (@asherber)

    Thanks!

    Thread Starter asherber

    (@asherber)

    Hi,

    My site isn’t live yet, so I can’t send you a link — but if it helps, I’ve created a gist that has page source with the plugin off and plugin on, so you can see the effect and maybe run some tests on the “before” source. (By the way, I initially thought that the problem might be that the menu item in question is called “Links”, but I changed the name to something else and the issue persisted, so I’m pretty sure it’s the fact that there’s no href.)

    https://gist.github.com/asherber/19ac1fa9e87bf36aa10d84280dd0f6c7

    Here’s the support info:

    WP url: https://appalachianspring.info
    WP version: 5.3
    PHP version: 7.2.24
    Active Plugins:
    – Blocks CSS: CSS Editor for Gutenberg Blocks, version: 1.0.2
    – DreamHost Panel Login, version: 1.0.0
    – Jetpack by WordPress.com, version: 8.0
    – Maintenance, version: 3.85
    – PHP Everywhere, version: 2.0.1
    – Simple CSS, version: 1.1
    – WP External Links, version: 2.40
    – WPForms Lite, version: 1.5.6.2
    – WP Super Cache, version: 1.7.0

    WPEL Settings:
    array(
    ‘wpel-external-link-settings’ => array (
    ‘apply_settings’ => ‘1’,
    ‘target’ => ‘_blank’,
    ‘target_overwrite’ => ”,
    ‘rel_follow’ => ”,
    ‘rel_follow_overwrite’ => ”,
    ‘rel_noopener’ => ‘1’,
    ‘rel_noreferrer’ => ‘1’,
    ‘rel_external’ => ‘1’,
    ‘rel_sponsored’ => ”,
    ‘rel_ugc’ => ”,
    ‘title’ => ‘{title}’,
    ‘class’ => ”,
    ‘icon_type’ => ‘image’,
    ‘icon_image’ => ‘3’,
    ‘icon_dashicon’ => ‘dashicons-menu’,
    ‘icon_fontawesome’ => ‘fa-address-book’,
    ‘icon_position’ => ‘right’,
    ‘no_icon_for_img’ => ‘1’,
    ),
    ‘wpel-internal-link-settings’ => array (
    ‘apply_settings’ => ”,
    ‘target’ => ”,
    ‘target_overwrite’ => ”,
    ‘rel_follow’ => ”,
    ‘rel_follow_overwrite’ => ”,
    ‘rel_noopener’ => ‘1’,
    ‘rel_noreferrer’ => ‘1’,
    ‘title’ => ‘{title}’,
    ‘class’ => ”,
    ‘icon_type’ => ”,
    ‘icon_image’ => ‘1’,
    ‘icon_dashicon’ => ”,
    ‘icon_fontawesome’ => ”,
    ‘icon_position’ => ‘right’,
    ‘no_icon_for_img’ => ‘1’,
    ),
    ‘wpel-excluded-link-settings’ => array (
    ‘apply_settings’ => ”,
    ‘target’ => ”,
    ‘target_overwrite’ => ”,
    ‘rel_follow’ => ”,
    ‘rel_follow_overwrite’ => ”,
    ‘rel_noopener’ => ‘1’,
    ‘rel_noreferrer’ => ‘1’,
    ‘title’ => ‘{title}’,
    ‘class’ => ”,
    ‘icon_type’ => ”,
    ‘icon_image’ => ‘1’,
    ‘icon_dashicon’ => ”,
    ‘icon_fontawesome’ => ”,
    ‘icon_position’ => ‘right’,
    ‘no_icon_for_img’ => ‘1’,
    ),
    ‘wpel-exceptions-settings’ => array (
    ‘apply_all’ => ‘1’,
    ‘apply_post_content’ => ‘1’,
    ‘apply_comments’ => ‘1’,
    ‘apply_widgets’ => ‘1’,
    ‘skip_post_ids’ => ”,
    ‘ignore_classes’ => ”,
    ‘subdomains_as_internal_links’ => ”,
    ‘include_urls’ => ”,
    ‘exclude_urls’ => ”,
    ‘excludes_as_internal_links’ => ”,
    ‘ignore_script_tags’ => ‘1’,
    ‘ignore_mailto_links’ => ‘1’,
    ),
    ‘wpel-admin-settings’ => array (
    ‘own_admin_menu’ => ‘1’,
    ),
    );

    Forum: Fixing WordPress
    In reply to: Moderate Posts

    Well, here’s the guts of it:


    function mg_notify_admin($post_id) {
    $post = &get_post($post_id);
    $keyword = strtok($post->post_title, ' ');

    if (strstr('POST DONE', $keyword)) {
    $post_title = substr($post->post_title, strlen($keyword) + 1);
    $first_name = get_usermeta($post->post_author, 'first_name');
    $last_name = get_usermeta($post->post_author, 'last_name');

    $message = "A post has been submitted for moderation.\n"
    . "Author: $first_name $last_name \n"
    . "Title: $post_title";
    wp_mail(get_option('admin_email'), 'Moderation notification',
    $message);
    }
    }

    add_action('save_post', 'mg_notify_admin');

    (Sorry, can’t get indents to display correctly.)

    This will fire any time a post is saved and the first word of the title is either ‘POST’ or ‘DONE’. An email will be sent to the site admin letting them know that the post is there. The admin can then log in, edit the post, remove ‘POST’, and publish.

    Note also that this only emails the main site admin. This could be modified to loop through the list of users and notify any user with the publish_posts capability (or other specified criteria).

    Aaron.

    Forum: Fixing WordPress
    In reply to: Moderate Posts

    UPDATE: I’ve now written a mini-plugin that hooks the save_post action. Whenever a post is saved with POST in the title, WordPress automatically emails me with the author’s name and the post title. Then I can log in, edit as needed, and publish. This is a little niftier than the cron script I had before.

    (My authors who need moderation can only save posts, not publish on their own.)

    Aaron.

    Forum: Fixing WordPress
    In reply to: Moderate Posts

    FWIW, what I’ve done is ask my authors to preface their post subjects with the word POST when they’re ready for it to be looked at. I then wrote a quick PHP script which I run as a cron job; the script looks to see if there are any posts which start with POST and then emails me if there are, so I can go moderate.

    There are more complicated ways to do this, like writing it as a real plugin and hooking save_post. But it meets my needs for now.

    Aaron.

    Forum: Fixing WordPress
    In reply to: Moderate Posts

    I’ve been dealing with just this issue. There is a post moderation plugin at <https://www.blueeye.us/wordpress/2005/01/16/post-moderation-10-beta/&gt;, but it has not (yet) been updated to work with 2.0. It doesn’t send notification to admins, but it does add a menu item to display/edit/approve posts being held for moderation.

    In the meantime, I’m doing the same thing you are. New users are registered as ‘Contributors’. And Manage | Posts will show me who has saved drafts. I’m considering asking users to add something at the top like ‘READY’ to distinguish between drafts they’re still working on and drafts which are ready to go.

    Would *love* a real post moderation solution.

    Aaron.

Viewing 7 replies - 1 through 7 (of 7 total)