Title: a.blok's Replies | WordPress.org

---

# a.blok

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

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

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Toolset Types - Custom Post Types, Custom Fields and Taxonomies] [Plugin: Types – Custom Fields and Custom Post Types Management] "wpcf-" on custom fields](https://wordpress.org/support/topic/plugin-types-custom-fields-and-custom-post-types-management-wpcf-on-custom-fields/)
 *  [a.blok](https://wordpress.org/support/users/ablok/)
 * (@ablok)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/plugin-types-custom-fields-and-custom-post-types-management-wpcf-on-custom-fields/#post-2814243)
 * > I think that this topic is resolved, as no change in Types is required.
 * I also disagree. I don’t see interoperability as a luxury feature.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Toolset Types - Custom Post Types, Custom Fields and Taxonomies] [Plugin: Types – Custom Fields and Custom Post Types Management] "wpcf-" on custom fields](https://wordpress.org/support/topic/plugin-types-custom-fields-and-custom-post-types-management-wpcf-on-custom-fields/)
 *  [a.blok](https://wordpress.org/support/users/ablok/)
 * (@ablok)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/plugin-types-custom-fields-and-custom-post-types-management-wpcf-on-custom-fields/#post-2814241)
 * Sorry, there was an error in the above code. **Do not use it!**
    This works:
 *     ```
       function make_types_variables_controlled() {
           global $wpdb;
           $q = "SELECT option_value FROM {$wpdb->prefix}options WHERE option_name='wpcf-fields'";
           $rr = mysql_query($q);
           $old_value = mysql_result($rr, 0);
           $u = unserialize($old_value);
           if (!$u) $u = array();
           foreach (array_keys($u) as $key) {
       	$u[$key]['data']['controlled'] = 1;
           }
           $new_value = serialize($u);
           $q2 = "UPDATE {$wpdb->prefix}options SET option_value = '$new_value' WHERE option_name='wpcf-fields'";
           $rr2 = mysql_query($q2);
           return $rr2;
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Toolset Types - Custom Post Types, Custom Fields and Taxonomies] [Plugin: Types – Custom Fields and Custom Post Types Management] "wpcf-" on custom fields](https://wordpress.org/support/topic/plugin-types-custom-fields-and-custom-post-types-management-wpcf-on-custom-fields/)
 *  [a.blok](https://wordpress.org/support/users/ablok/)
 * (@ablok)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/plugin-types-custom-fields-and-custom-post-types-management-wpcf-on-custom-fields/#post-2814240)
 * Well, after some research I found a way to remove the wpcf- prefix to all fields.
   
   This is useful i.e. if you use Types to create the custom fields, but you don’t
   want to have the wp_post_meta table (and your php code) cluttered with the wpcf-
   prefix. Just run this function whenever you want to remove the prefix from all
   fields:
 *     ```
       function make_types_variables_controlled() {
           global $wpdb;
           $q = "SELECT option_value FROM {$wpdb->prefix}options WHERE option_name='wpcf-fields'";
           $rr = mysql_query($q);
           $r = mysql_result($rr, 0);
           $u = unserialize($r);
           foreach (array_keys($u) as $key) {
       	$u[$key]['data']['controlled'] = 1;
           }
           $ret = serialize($ret);
           $q2 = "UPDATE {$wpdb->prefix}options SET option_value = '$ret' WHERE option_name='wpcf-fields'";
           $rr2 = mysql_query($q2);
           return $rr2;
       }
       ```
   
 * I tried it and it seems to do the job.
    I don’t know if there are any downsides
   to this. Use it at your own risk and backup the database before trying to use
   it (if something goes wrong you might lose all of your Types fields). Cheers!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[User Frontend: AI Powered Frontend Posting, User Directory, Profile, Membership & User Registration] [Plugin: WP User Frontend] Image attachment not working error in JS file](https://wordpress.org/support/topic/plugin-wp-user-frontend-image-attachment-not-working-error-in-js-file/)
 *  [a.blok](https://wordpress.org/support/users/ablok/)
 * (@ablok)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-wp-user-frontend-image-attachment-not-working-error-in-js-file/#post-2823433)
 * Hi applegateian,
    there is an error in your script: `global $post;` must be the
   first line after `function scripts() {`
 * Just move the line of code and it should work.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[User Frontend: AI Powered Frontend Posting, User Directory, Profile, Membership & User Registration] [Plugin: WP User Frontend] Image attachment not working error in JS file](https://wordpress.org/support/topic/plugin-wp-user-frontend-image-attachment-not-working-error-in-js-file/)
 *  [a.blok](https://wordpress.org/support/users/ablok/)
 * (@ablok)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-user-frontend-image-attachment-not-working-error-in-js-file/#post-2823425)
 * f1mktsol, the easy way is to insert the shortcode in the page/post and not in
   the template file.
 * If that is not possible, you will have to hack the lib/attachment.php and do 
   something along the lines of
    substitute (2 times in the script) `has_shortcode('
   wpuf_addpost' )` with `$post->ID == 11111 || has_shortcode( 'wpuf_addpost' )`
   and add `global $post;` in a new line under `function scripts() {`
 * Replace 11111 in the code above with your post/page ID.
    This code is not tested.
   Hope it helps!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[User Frontend: AI Powered Frontend Posting, User Directory, Profile, Membership & User Registration] [Plugin: WP User Frontend] Image attachment not working error in JS file](https://wordpress.org/support/topic/plugin-wp-user-frontend-image-attachment-not-working-error-in-js-file/)
 *  [a.blok](https://wordpress.org/support/users/ablok/)
 * (@ablok)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-user-frontend-image-attachment-not-working-error-in-js-file/#post-2823423)
 * Hi folks!
    if nothing happens when you click on the add image button, and you
   get no js error at all (like it happened to me) this is probably because you 
   are loading the shortcodes from a php file using a page template.
 * For example, I was using this in my template file:
    `<?php echo do_shortcode('[
   wpuf_addpost]'); ?>`
 * But, the attachment.php has this logic for loading the scripts:
    `if ( has_shortcode('
   wpuf_addpost' ) || has_shortcode( 'wpuf_edit' ) || has_shortcode( 'wpuf_dashboard'))`
 * and I found out that it returns false if you load the shortcode from php.
    I 
   think this is a bug and should be fixed. Cheers!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Dave's WordPress Live Search] [Plugin: Dave's WordPress Live Search] apply_filters – localization desn't work](https://wordpress.org/support/topic/plugin-daves-wordpress-live-search-apply_filters-localization-desnt-work/)
 *  [a.blok](https://wordpress.org/support/users/ablok/)
 * (@ablok)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-daves-wordpress-live-search-apply_filters-localization-desnt-work/#post-2300997)
 * Hi. It would be nice to know how to fix this issue! Can you guys please give 
   me some insights?
    Thanks Alexander
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[MailChimp Widget] [Plugin: MailChimp Widget] Form not working](https://wordpress.org/support/topic/plugin-mailchimp-widget-form-not-working/)
 *  Thread Starter [a.blok](https://wordpress.org/support/users/ablok/)
 * (@ablok)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-mailchimp-widget-form-not-working/#post-2428067)
 * Hi James,
    thanks for checking out. I deactivated the plugin that created the
   JS errors. Now both Chrome’s Dev Tools and Firebug for Firefox tell me the JS
   is ok. But the problem still remains. Cheers! Alexander

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