Tag Info

New answers tagged

0

Search for add_meta_box(). This function is the key to add custom areas to the edit screen and inside this can you handle your custom requirements.


0

After trying everything, this worked for me: global $allowedposttags; $allowedposttags['div'] = array('align' => array (), 'class' => array (), 'id' => array (), 'dir' => array (), 'lang' => array(), 'style' => array (), 'xml:lang' => array() ); $allowedposttags['iframe'] = array('src' => array () ); ...


0

The hook to use here is admin_notices. However in register_activation_hook and register_deactivation_hook it shouldn't be used because these function run when plugin activates and deactivates instance. A workaround it we use add_option when plugin activates and delete_option when plugin deactivates. Here is the code. Hopefully you will understand it ...


1

Where in core ? These parts here and here, are responsible for overriding the image title with meta data: // ... cut ... // Use image exif/iptc data for title and caption defaults if possible. } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = @wp_read_image_metadata( $file ) ) { if ( trim( ...


0

You have to use global $sitepress and use it's switch_lang method global $sitepress; if ( isset($_GET['lang']) ) { if ( $_GET['lang'] == 'en' ) { // set the user admin language preference to en_US $sitepress->switch_lang('en', true); } elseif ( $_GET['lang'] == 'es' ) { ...


3

You'll need to log onto your FTP server and goto the wp-content folder -> plugins -> and delete the GZIP plugin you have installed. If you are not sure about FTP, you can probably try and go through your web server control panel, they usually have some sort of file browsing option. You might also need to check the .htaccess file also, but just try removing ...


0

@ hannit cohen, This is best way to hide the Add New or Create New button in custom postypes 'capability_type' => 'post', 'capabilities' => array( 'create_posts' => false ), 'map_meta_cap' => true, It disable to create new post in custom post types both side in admin menu and above the list of post ...


0

Found it - it was a bug in the plugin itself: https://wp-types.com/forums/topic/commercial-tab-not-showing-to-register/


-1

you must define path to current site like this : define('PATH_CURRENT_SITE', '/wordpress/');


0

Milo's answer is correct. I just wanted to add some details about how the check is done (because get_filesystem_method() has changed a bit since 2011). Firstly, you can completely override this check by defining FS_METHOD in your wp-config.php to be 'direct', 'ssh2', 'ftpext' or 'ftpsockets'. If this constant isn't set, then WP tries to determine what ...


0

At first glance it works and I cannot see any implications but maybe you are aware of some? You say that you are not getting errors, which I would have expected but it looks as though WordPress uses require_once() so you are probably safe: 39 /** WordPress Plugin Administration API */ 40 require_once(ABSPATH . 'wp-admin/includes/plugin.php'); ...


0

Yes, it is possible to limit the drag and drop functionality of your boxes. All one needs to do is find the right selectors for the specific boxes it wants to target. When you use $(".meta-box-sortables").[...] you are targeting all elements in the page with the class of meta-box-sortables. If, however, you add a custom class to any of those boxes, for ...


1

You can hack by adding below lines in your theme's functions.php file. function remove_preview_target() { // below JS code will set Preview button's **target** attribute to **_self**, it means same tab/window. echo "<script> jQuery(document).ready(function(){ jQuery('#post-preview').attr('target', '_self'); }) ...


1

Check to see if your functions.php file includes a filter for login_errors. For example, this would disable any login errors from being displayed: add_filter('login_errors', function($error){ return null; }); This is sometimes done as a security measure so the reason a login attempt failed isn't available to any would-be hacker or bot. More info on this ...


0

The hooks are important, no matter how we sorted form fields inside the function. Follow my inline comments. As of WordPress 4.2.2 we have plenty of hooks now: <?php /** * Declaring the form fields */ function show_my_fields( $user ) { $fetched_field = get_user_meta( $user->ID, 'my_field', true ); ?> <tr class="form-field"> ...


0

If you can deploy wp-cli on WAMP, just use the wp user create command. A much saner way to do it than trying to do it in phpMyAdmin.


0

I think you should create password in form of MD5, suggested by @passatgt. Also one point is missed that you not mentioned so I suggest to check your 'siteurl' and 'home' fields from db table. The two fields you need to edit are 'siteurl' and 'home'. Replace the URL contained in "option_value" with http://localhost/yourfoldername/. It's done. PS:If this ...


0

A very simple experiment... add_action('admin_init','get_header'); add_action('admin_init','get_footer'); ... will demonstrate that the get_header() and get_footer() functions work on the back end as well as the front, though you will need to adjust for numerous markup problems and other issues. Honestly, you question seems to be "how do I get the site ...


1

Edit the user in phpmyadmin, enter the password as text in the user_pass field and there is a “Function” column with drop down boxes. On this field just select MD5 in the function column. When you save it phpMyAdmin will automatically md5 hash it for you.


0

Question #1 - The above code will output 23123 twice, when visiting plugin page and when not. How do I make it print the content of my page only when page is the current screen? Basically: http://localhost/wp-admin/admin.php?page=camden-vmtool When you initialize the class, you are hooking the pageInit() method into a hook that fires on all admin ...


0

use this at functions.php /* Tagcloud, change the font size */ function custom_tag_cloud_widget($args) { $args['largest'] = 13; //largest tag $args['smallest'] = 13; //smallest tag $args['unit'] = 'px'; //tag font unit return $args; } add_filter( 'widget_tag_cloud_args', 'custom_tag_cloud_widget' );


0

I figured out it was because of an script that was delivered with the Options Framework. There was a little piece of code in my functions.php which caused wrong javascript to be loaded. When you are having the same problem, be sure to search for something like wp_enqueue_media(); or something of the following script, comment out and try to upload a ...


0

You can use like this for send ajax... function my_action_javascript() { ?> <script type="text/javascript"> jQuery(document).ready(function ($) { var data = { 'action': 'my_action', 'whatever': '1' }; $.post(ajaxurl, data, function (response) { if ...


-1

You need to add support for thumbnails in your theme. So, put this in your theme files: function custom_theme_setup() { add_theme_support( $feature, $arguments ); } add_action( 'after_setup_theme', 'custom_theme_setup' ); This enables the thumbnail/feature image support for all post types in your current theme including normal posts and pages.



Top 50 recent answers are included