Title: maccast's Replies | WordPress.org

---

# maccast

  [  ](https://wordpress.org/support/users/maccast/)

 *   [Profile](https://wordpress.org/support/users/maccast/)
 *   [Topics Started](https://wordpress.org/support/users/maccast/topics/)
 *   [Replies Created](https://wordpress.org/support/users/maccast/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/maccast/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/maccast/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/maccast/engagements/)
 *   [Favorites](https://wordpress.org/support/users/maccast/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 62 total)

1 [2](https://wordpress.org/support/users/maccast/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/maccast/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/maccast/replies/page/4/?output_format=md)
[5](https://wordpress.org/support/users/maccast/replies/page/5/?output_format=md)
[→](https://wordpress.org/support/users/maccast/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[User Login History] show login failed new users (admin) ?](https://wordpress.org/support/topic/show-login-failed-new-users-admin/)
 *  [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/show-login-failed-new-users-admin/#post-10645087)
 * Hey [@fimo66](https://wordpress.org/support/users/fimo66/) how did you solve 
   this? I’m having the same issue where we use a custom login form but I don’t 
   see any “failed” login attempts with the plugin-in
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[ReOrder Posts within Categories] Apply Sort Order to custom query](https://wordpress.org/support/topic/apply-sort-order-to-custom-query/)
 *  Thread Starter [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/apply-sort-order-to-custom-query/#post-9966781)
 * Hey, thanks for the reply and the explanation. I do understand the mysql order/
   limit syntax. Sorry, I just really didn’t have enough background with the code
   to understand how it was working in this context. Yes, I am looping over my results,
   but the issue is those results, at least for me, still don’t seem to be sorted
   in the correct order. It is entirely possible I’ve made an error someplace else
   in my code and I will look into this. I really appreciate your help. Thank you.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[ReOrder Posts within Categories] Apply Sort Order to custom query](https://wordpress.org/support/topic/apply-sort-order-to-custom-query/)
 *  Thread Starter [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/apply-sort-order-to-custom-query/#post-9964038)
 * Yes, but as you can see it wouldn’t work because for some odd reason it has a`
   ASC LIMIT 0, 1` on it. Meaning there is nothing to “order” since it’s only one
   result. That’s why i=I wasn’t sure it was the correct query. If I remove the `
   limit` it does appear to return the correct items.
    -  This reply was modified 8 years, 2 months ago by [maccast](https://wordpress.org/support/users/maccast/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[ReOrder Posts within Categories] Apply Sort Order to custom query](https://wordpress.org/support/topic/apply-sort-order-to-custom-query/)
 *  Thread Starter [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/apply-sort-order-to-custom-query/#post-9939940)
 * Not sure exactly what I’m looking at, buthere is the full SQL query I’m seeing:
 * SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships
   ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_reorder_post_rel
   ON wp_posts.ID = wp_reorder_post_rel.post_id and incl = 1 WHERE 1=1 AND ( wp_term_relationships.
   term_taxonomy_id IN (29) ) AND wp_posts.post_type = 'menu-item' AND (wp_posts.
   post_status = 'publish' OR wp_posts.post_status = 'acf-disabled' OR wp_posts.
   post_status = 'private') AND wp_reorder_post_rel.category_id = '29' GROUP BY 
   wp_posts.ID ORDER BY wp_reorder_post_rel.id ASC LIMIT 0, 1
 * There is an `INNER JOIN wp_reorder_post_rel ON wp_posts.ID = wp_reorder_post_rel.
   post_id`, but when the page is rendered the items are not displayed in the custom
   order.
    -  This reply was modified 8 years, 3 months ago by [maccast](https://wordpress.org/support/users/maccast/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[ReOrder Posts within Categories] Apply Sort Order to custom query](https://wordpress.org/support/topic/apply-sort-order-to-custom-query/)
 *  Thread Starter [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/apply-sort-order-to-custom-query/#post-9742232)
 * Ok, well I’m maybe a bit confused then because you can see from my code above
   that I’m using `WP_Query` and I am NOT setting `suppress_filters=true`, but the
   results I’m getting are not being sorted in the custom order. Do you know why
   that might be?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Broken Dropdown Menus](https://wordpress.org/support/topic/broken-dropdown-menus/)
 *  [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/broken-dropdown-menus/#post-9402280)
 * We are also having this issue and we use Subscriptions. [@cipherdicer442](https://wordpress.org/support/users/cipherdicer442/),
   did you say the plug-in authors are saying not to upgrade? Do you have a link
   or more information?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Publish To Apple News] Missing ‘Read Full Story’ Link](https://wordpress.org/support/topic/missing-read-full-story-link/)
 *  [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [9 years ago](https://wordpress.org/support/topic/missing-read-full-story-link/#post-9047300)
 * Sorry for the double post, but I can’t seem to delete now.
 * Here’s the missing screenshot:
 * ![](https://i0.wp.com/www.maccast.com/images/read_original_apple_news.jpg)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Publish To Apple News] Missing ‘Read Full Story’ Link](https://wordpress.org/support/topic/missing-read-full-story-link/)
 *  [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [9 years ago](https://wordpress.org/support/topic/missing-read-full-story-link/#post-9047158)
 * So we came up with a solution for this that seems to work. I wish I had more 
   control over the display formatting, but at least this bring back the missing
   functionality. The solution involves making two filter calls. We put these in
   a custom theme plug-in, but they could also be added to the `functions.php` file
   of your theme.
 * The first call uses the `apple_news_generate_json` filter. In it I add a couple
   of `textStyles` JSON entries to the top level properties on main JSON object.
   These will be used to apply in-line text styles to the markdown code which you’ll
   see later. See Apple’s docs on the [textStyle](https://developer.apple.com/library/content/documentation/General/Conceptual/Apple_News_Format_Ref/TextStyle.html)
   for more info. Here is the code:
 *     ```
       function add_text_styles_to_apple_news($json, $content_id) {
   
         /* Add custom inline styles */
         $json['textStyles'] = array(
           'read-original-url' => array(
             'fontName'    => 'AvenirNext-Regular',
             'fontSize'    => 14,
             'textColor'   => '#0a5785',
           ),
           'read-original-link' => array(
             'fontName'    => 'AvenirNext-Bold',
             'fontSize'    => 14,
             'textColor '  => '#666',
           )
         );
   
         return $json;
       }
   
       add_filter( 'apple_news_generate_json', 'add_text_styles_to_apple_news', 10, 2 );
       ```
   
 * This defines two new `textStyles`: `read-original-url` and `read-original-link`.
   These can be used later using Apple News’ inline text style. The basic format
   is `Example of [text to be styled]{read-original-url}` where the text you want
   to apply the style to is in the square braces and the style to apply to it is
   in the curly braces (in this example the `read-original-url` style which we defined
   with the filter call above).
 * The second filter call we used is `apple_news_exporter_content_pre`. In here 
   we are simply appending the “Read Original” text and link to the content before
   it’s parsed by the Apple News plugin. Here’s the code:
 *     ```
       function add_content_to_apple_news($content, $ID) {
   
        $post = get_post($ID);
   
        //create the Read Full Story link and apply the styles
        $link = sprintf('<p>[Read Original:]{tmo-read-original-link} [[%s](%s)]{read-original-url}</p>', $post->post_title, get_permalink($ID) );
   
         $content .= $link; //append link to content
   
         return $content;
       }
       add_filter( 'apple_news_exporter_content_pre', 'add_content_to_apple_news', 10, 2 );
       ```
   
 * This is fairly straight forward. We grab the post object using the `$ID` and 
   then build out our link content and append it to `$content` and return it.
 * That’s it. For us this is working well. In our case the result looks like this
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Publish To Apple News] Missing ‘Read Full Story’ Link](https://wordpress.org/support/topic/missing-read-full-story-link/)
 *  [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [9 years ago](https://wordpress.org/support/topic/missing-read-full-story-link/#post-9047157)
 * Not sure what happened, but I had posted out solution to this, but when I tried
   to add a screenshot the whole post disappeared. I attempted to re-post it, but
   nothing is happening. In case it never shows back up here is a gist with the 
   same content: [https://gist.github.com/phylaxis/db31ae99fc5670235d810311fb09eddb](https://gist.github.com/phylaxis/db31ae99fc5670235d810311fb09eddb)
    -  This reply was modified 9 years ago by [maccast](https://wordpress.org/support/users/maccast/).
    -  This reply was modified 9 years ago by [maccast](https://wordpress.org/support/users/maccast/).
      Reason: Adding link to GIST
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Publish To Apple News] Missing ‘Read Full Story’ Link](https://wordpress.org/support/topic/missing-read-full-story-link/)
 *  [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [9 years ago](https://wordpress.org/support/topic/missing-read-full-story-link/#post-9047138)
 * So we came up with a solution for this that seems to work. I wish I had more 
   control over the display formatting, but at least this bring back the missing
   functionality. The solution involves making two filter calls. We put these in
   a custom theme plug-in, but they could also be added to the `functions.php` file
   of your theme.
 * The first call uses the `apple_news_generate_json` filter. In it I add a couple
   of `textStyles` JSON entries to the top level properties on main JSON object.
   These will be used to apply in-line text styles to the markdown code which you’ll
   see later. See Apple’s docs on the [textStyle](https://developer.apple.com/library/content/documentation/General/Conceptual/Apple_News_Format_Ref/TextStyle.html)
   for more info. Here is the code:
 *     ```
       function add_text_styles_to_apple_news($json, $content_id) {
   
         /* Add custom inline styles */
         $json['textStyles'] = array(
           'read-original-url' => array(
             'fontName'    => 'AvenirNext-Regular',
             'fontSize'    => 14,
             'textColor'   => '#0a5785',
           ),
           'read-original-link' => array(
             'fontName'    => 'AvenirNext-Bold',
             'fontSize'    => 14,
             'textColor '  => '#666',
           )
         );
   
         return $json;
       }
   
       add_filter( 'apple_news_generate_json', 'add_text_styles_to_apple_news', 10, 2 );
       ```
   
 * This defines two new `textStyles`: `read-original-url` and `read-original-link`.
   These can be used later using Apple News’ inline text style. The basic format
   is `Example of [text to be styled]{read-original-url}` where the text you want
   to apply the style to is in the square braces and the style to apply to it is
   in the curly braces (in this example the `read-original-url` style which we defined
   with the filter call above).
 * The second filter call we used is `apple_news_exporter_content_pre`. In here 
   we are simply appending the “Read Original” text and link to the content before
   it’s parsed by the Apple News plugin. Here’s the code:
 *     ```
       function add_content_to_apple_news($content, $ID) {
   
        $post = get_post($ID);
   
        //create the Read Full Story link and apply the styles
        $link = sprintf('<p>[Read Original:]{tmo-read-original-link} [[%s](%s)]{read-original-url}</p>', $post->post_title, get_permalink($ID) );
   
         $content .= $link; //append link to content
   
         return $content;
       }
       add_filter( 'apple_news_exporter_content_pre', 'add_content_to_apple_news', 10, 2 );
       ```
   
 * This is fairly straight forward. We grab the post object using the `$ID` and 
   then build out our link content and append it to `$content` and return it.
 * That’s it. For us this is working well. In our case the result looks like this:
 * ![Apple News Screenshot](https://www.dropbox.com/s/jteegiwb1o82czd/read_original_apple_news.
   jpg?dl=0)
    -  This reply was modified 9 years ago by [maccast](https://wordpress.org/support/users/maccast/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Publish To Apple News] Missing ‘Read Full Story’ Link](https://wordpress.org/support/topic/missing-read-full-story-link/)
 *  [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [9 years ago](https://wordpress.org/support/topic/missing-read-full-story-link/#post-9043188)
 * I was digging into a solution for this and trying to use some of the filters.
   Using the `apple_news_exporter_content_pre` filter it’s possible to add the link
   and content to the end of the body, but there doesn’t seem to be nay way to control
   the styles or formatting to match the original look.
 * I then saw the `apple_news_initialize_components` would that work for adding 
   additional `role:body` elements and styles?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Jetpack - WP Security, Backup, Speed, & Growth] Publicize – point to custom url](https://wordpress.org/support/topic/publicize-point-to-custom-url/)
 *  [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/publicize-point-to-custom-url/#post-8918756)
 * Great. Thank you for your replies and the info. I’ll keep an eye on the GitHub.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Jetpack - WP Security, Backup, Speed, & Growth] Publicize – point to custom url](https://wordpress.org/support/topic/publicize-point-to-custom-url/)
 *  [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/publicize-point-to-custom-url/#post-8918094)
 * Is there possibly a workaround using a regex and a hook on the Publicize message?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Jetpack - WP Security, Backup, Speed, & Growth] Publicize – point to custom url](https://wordpress.org/support/topic/publicize-point-to-custom-url/)
 *  [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/publicize-point-to-custom-url/#post-8914644)
 * Hey [@jeherve](https://wordpress.org/support/users/jeherve/), I have a similar
   but I think slightly different need. I need to override the URLs that are used
   in the Publicize posts that go out when you publish an article with Publicize
   active. Would the filter mentioned here work for that or is there a different
   one?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Restrict Author Posting] Restrict the custom post type categories?](https://wordpress.org/support/topic/restrict-the-custom-post-type-categories/)
 *  [maccast](https://wordpress.org/support/users/maccast/)
 * (@maccast)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/restrict-the-custom-post-type-categories/#post-8227764)
 * I would also be interested in this functionality. Has anyone been able to figure
   out how to do this?

Viewing 15 replies - 1 through 15 (of 62 total)

1 [2](https://wordpress.org/support/users/maccast/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/maccast/replies/page/3/?output_format=md)
[4](https://wordpress.org/support/users/maccast/replies/page/4/?output_format=md)
[5](https://wordpress.org/support/users/maccast/replies/page/5/?output_format=md)
[→](https://wordpress.org/support/users/maccast/replies/page/2/?output_format=md)