Websnippetz

Get cool snippets on php, css, jQuery, Magento and wordpress

Category: Wordpress

Here is the code to Upload swf file in wordpress. function swf_upload($mimes) { if (function_exists(‘current_user_can’)){ $unfiltered = $user ? user_can($user, ‘unfiltered_html’) : current_user_can(‘unfiltered_html’); } if (!empty($unfiltered)) { $mimes[‘swf’] = ‘application/x-shockwave-flash’;…

Creating wordpress short-codes is simple. We can access custom field value through shortcode, just follow the function. add_shortcode(‘field’, ‘shortcode_field’); function shortcode_field($atts){ extract(shortcode_atts(array( ‘post_id’ => NULL, ), $atts)); if(!isset($atts[0]) return; $field = esc_attr($atts[0]);…