Title: OffWorld's Replies | WordPress.org

---

# OffWorld

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

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

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Local Avatars] Use on frontend Profile form?](https://wordpress.org/support/topic/use-on-frontend-profile-form/)
 *  Thread Starter [OffWorld](https://wordpress.org/support/users/offworld/)
 * (@offworld)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/use-on-frontend-profile-form/#post-15063894)
 * I got it to show up on the front-end in a custom form in a custom template with:
 *     ```
       do_action('show_user_profile',$current_user);
       do_action('edit_user_profile',$current_user);
       ```
   
 * Which loops in all the theme and plugin additions to the admin User Profile (
   but just the form elements, not any admin scripts or stylesheets that go with
   them). Looking at those two other threads you linked to I now see where I was
   probably going wrong in my form validation function.
 * Ultimately for the site project in my original post I ended up using the “One
   User Avatar” plugin which has built-in methods for adding the form to the front-
   end.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[One User Avatar | User Profile Picture] Feature Request for more granular control over who can upload images](https://wordpress.org/support/topic/feature-request-for-more-granular-control-over-who-can-upload-images/)
 *  Thread Starter [OffWorld](https://wordpress.org/support/users/offworld/)
 * (@offworld)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/feature-request-for-more-granular-control-over-who-can-upload-images/#post-14968687)
 * Well that’s good to know and exactly what I need.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Social Sharing Toolkit] Linksalpha button…really?](https://wordpress.org/support/topic/linksharereally/)
 *  [OffWorld](https://wordpress.org/support/users/offworld/)
 * (@offworld)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/linksharereally/page/3/#post-4207441)
 * Update screwed up my layout so I reverted to previous version. I just edited 
   the version number at the top of the php file (changed it to “10.0” – though 
   any number higher than the actual current version would work). At least now it
   doesn’t constantly bug me about there being an update, but it’s only a hack while
   I consider alternatives (or if someone just forks this plugin without the nonsense).
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Show ONLY shortcode content](https://wordpress.org/support/topic/show-only-shortcode-content/)
 *  Thread Starter [OffWorld](https://wordpress.org/support/users/offworld/)
 * (@offworld)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/show-only-shortcode-content/#post-2558121)
 * yep, the regex part is pretty much an identical case. Except the content in my
   shortcode doesn’t require I enqueue any scripts, so I was able to put my code
   right inside the loop within my single-custom.php file. Though I believe I read
   somewhere that WP 3.3 now allows you to enqueue scripts mid-page as well.
 * I’m just glad I got it to finally work so I can move on to the next part I need
   to fix!
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Show ONLY shortcode content](https://wordpress.org/support/topic/show-only-shortcode-content/)
 *  Thread Starter [OffWorld](https://wordpress.org/support/users/offworld/)
 * (@offworld)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/show-only-shortcode-content/#post-2558114)
 * Ok, finally figured out something that does exactly what I want it to do. Not
   sure this is the “best” way, but I’ll use it since it works. Inside my loop:
 *     ```
       $pattern = get_shortcode_regex();
       		preg_match_all( '/'. $pattern .'/s', $post->post_content, $matches );
   
       		if( is_array( $matches ) && array_key_exists( 2, $matches ) && in_array( 'myshortcode', $matches[2] ) )
       		{
       			foreach ($matches[0] as $value) {
       				$value = wpautop( $value, true );
       				echo do_shortcode($value);
       			}
       		} else {
       			// Do Nothing
       		}
       ```
   
 * So I regex the post content looking for my shortcode, if it doesn’t find any 
   instances it does nothing, if it does for each instance I grab the value of it,
   run it through the wpautop filter (to clean it up), then reconstruct the shortcode
   on the fly with do_shortcode().
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Show ONLY shortcode content](https://wordpress.org/support/topic/show-only-shortcode-content/)
 *  Thread Starter [OffWorld](https://wordpress.org/support/users/offworld/)
 * (@offworld)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/show-only-shortcode-content/#post-2558112)
 * No, it’s not a page template. It’s a single-custom.php custom post_type.
 * do_shortcode() – unless I’m misunderstanding – seems to be when you want to create
   an instance of a shortcode somewhere it normally wouldn’t appear. But the shortcodes
   I’m dealing with already exist in the post and already normally appear with the
   unfiltered the_content().
 * I’m kinda new to PHP and WP plugins so I haven’t fully wrapped my head around
   add_filter and apply_filters. I feel like those are probably what I want, I just
   don’t know how to get the output I want from them.
 * Using the add_filter example on the do_shortcode codex page just spits back a
   number “1” and a suggestion I found somewhere online of echoing apply_filters(‘
   the_content’,'[myshortcode]’) gives me the shortcode wrapper HTML, but none of
   the $content in it, none of the $atts, and only one instance (even though the
   custom post has multiple instances).
 * I wouldn’t think filtering the post to just display the content and atts of a
   shortcode would be this difficult!
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Show ONLY shortcode content](https://wordpress.org/support/topic/show-only-shortcode-content/)
 *  Thread Starter [OffWorld](https://wordpress.org/support/users/offworld/)
 * (@offworld)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/show-only-shortcode-content/#post-2558086)
 * That was the first thing I tried, figuring it’s purpose is to JUST “do the shortcode”
   but I’ve tried code based on the examples on that page and they just seem to 
   filter out all the post content, including the stuff inside the shortcode.
 * The only real-world examples I’ve found so far are about using shortcodes in 
   widgets and sidebars. This is being used in a custom post_type where I have the
   shortcode working, I just want to get rid of anything in the_content() that isn’t
   the shortcode.

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