Tag Info

Hot answers tagged

5

SOLUTION: after_switch_theme does exactly what I intended here. It fires after the theme is switched TO your theme. One of the solutions mentioned below uses switch_theme. This does not have the desired results, since it only happens upon switching away from your theme. Here is an article that I found as reference: ...


4

The after_setup_theme action is intended to fire on every WordPress load. It is simply part of the process during which WordPress invokes the template system, determines the various setup parameters for the Theme, and then proceeds on with subsequent processing, such as determining the correct template to display, etc. In other words, the after_setup_theme ...


4

You're misinterpreting the is_admin() function. It's not a tag to check whether or not the user is an admin, it's a template tag to check if you're on an admin page. From the Codex: This Conditional Tag checks if the Dashboard or the administration panel is being displayed. This is a boolean function, meaning it returns either TRUE or FALSE. You're ...


4

No, apparently not. Until this behavior is changed in version 3.7 you can add this filter to your theme's functions.php file to include additional extensions. Edited: I've updated the filter with better code suggested in the comments. Lower case and uppercase extensions function my_custom_audio_extensions( $exts ) { //merge array of upper case ...


4

Looks like this is a defect. Ish. As @s_ha_dum mentioned, this is to prevent a directory traversal attack. However, Wordpress' Media Library will happily let you upload a file with two or more periods in a row, even if ms-files.php will refuse to serve it up. So, nothing is technically "broken", but this certainly isn't ideal. There's a patch to prevent ...


3

This is how i set my content directory in wp-config.php // ======================== // Custom Content Directory // ======================== define( 'WP_CONTENT_DIR', dirname( __FILE__ ) . '/somedir' ); define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/somedir' );


3

Are you by chance using Firefox to test your page? If so its prefetching function combined with WordPress rel='next' could be the culprit. Check your page source for those rel tags, and see if Firebug registers an extra GET request to the page specified in the href attribute of the rel tag. There is a Firefox extension Fasterfox, and it will prefetch ...


3

The is_admin() only checks for if current visitor is on admin page or not. To block any non admin user from visting any admin page use current_user_can(); function. Here's an example to check if current user is not a admin. if ( ! current_user_can( 'manage_options' ) ) { echo 'You should not see this if you\'re not logged in!'; } #1 Update - ...


2

Plugins with Network: true in their header cannot be seen, activated or deactivated in sub sites. The reason is simple: You need super admin rights to do something with them, and their settings section (if there are any) are visible in wp-admin/network/ only. Even if you are the super admin and on a sub site you will not see those menus usually, because the ...


2

On line 704 it mentions something about "User_ID => 5". Not sure, but this might have something to do with your problem? // debug shit $args = array('user_ID' => 5); rhb_check_user_badges( $args );


2

Maybe this can help delete_option('taxonomy-slug_children'); just replace the 'taxonomy-slug' with 'cat' or other taxonomy you are using. This line is supposed to used in the same action hook function, right after you create the term.


2

Unfortunately there is no theme-activation hook. However, a this question does provide a work-around for that. Simply use the 'theme activation hook' to activate the plug-ins. A better solution, along the same vein is this one. Both essentially use the switch_theme hook. As per the OP comments and the linked trac ticket - after_switch_theme is the hook ...


2

From PHP docs (emphasis mine): preg_match() returns the number of times pattern matches. That will be either 0 times (no match) or 1 time because preg_match() will stop searching after the first match. preg_match_all() on the contrary will continue until it reaches the end of subject.


2

My suspicion is that, for some reason, the name "51m series" or slug 51m-series is (or both are) matching is_category( 51 ). The is_category() function uses the PHP in_array() conditional to match against ID, slug, and name: if ( in_array( $cat_obj->term_id, $category ) ) return true; elseif ( in_array( $cat_obj->name, $category ) ) return ...


1

In my experience this happens when you initiate an operation (Save/Update) and then try to leave the page to do something else before the requested operation has completed. Next time you save/update a post wait until the edit page returns to normal and displays your content. Then navigate away from the edit page. Chances are that you will not get that ...


1

I believe @JMau is referring to the following: The actual image is only 211px wide, it displays at 281px wide, therefore pixelation is occurring. The bigger issue here is that the little thumbnail image displaying to the left of the main product image is throwing the alignment off. Add the following to your custom CSS styles to fix the alignment: ...


1

Where/how are you defining $category_id? Reference the Codex entry for WP_Query() category parameters. WP_Query() expects category IDs to be passed as integers, not as strings: If $category_id is an integer, pass it to 'cat'. If $category_id is an array (of category IDs, again as integers), pass it to 'category__in'


1

It's because you've hooked it to the wrong action, it should be admin_menu, not admin_init.


1

It doesn't look like you're calling add_action() correctly. It should be more like: add_action( 'edit_page_form', 'wpse96952_editor' ); function wpse96952_editor() { wp_editor( "Sample", 'mycontent', array( 'textarea_name' => 'mycontent' ) ); } (content changed to mycontent after I read @vancoder's comment)


1

The answer to this question was simply that the built-in password protection does not apply if you are using a custom template that doesn't include the_loop(). Lesson learnt.


1

TinyMCE is generally cross-browser compatible. However they provide the best support for IE, Firefox and Safari. I've never ran into problems with my beloved Opera too. http://www.tinymce.com/wiki.php/Browser_compatiblity If there are any bugs they're mostly not browser-dependent, but if they are - try Firefox, Safari, Opera, IE - in that order.


1

The Bug …is well known, but it's not a bug. It's an Error, that you don't display. The Fix Move into your ~/wp-config.php file. Then add define( 'WP_DEBUG', true ); and read your Error message.


1

I suggest you use the built in wp_editor() function. Google "wp_editor wordpress codex" and Check out this tutorial Using the WP Editor Function


1

Sounds like a couple of possibilities 1) an upgrade that may not have completed successfully or fully - try reloading wordpress completely (download and ftp). This has happening to a few folk or 2) a plugin that may not be compatible with new version. For debugging purposes, try deactivating one by one till problem goes away (or deactivate all, then ...


1

Most likely "Search RegEx" triggered a filter/action that "Add Linked Images..." was attached to, which caused the import.


1

I asked the same question a while ago. Scribu gave me an answer here. The long and short of it: after you insert your terms, add this line of code. delete_option("my_custom_taxonomy_children"); Of course, replace my_custom_taxonomy with your own, but leave the _children part.


1

Try the fix posted here: http://sourceforge.net/tracker/?func=detail&aid=3485384&group_id=315685&atid=1328061 It worked for me. translations.php line 726 Change this: $pattern = '/LIMIT\s*(\d+)((\s*,?\s*)(\d+))(;{0,1})$/is'; to this: $pattern = '/LIMIT\s(\d+)((\s*,?\s*)(\d+)*);{0,1}$/is'; Removing the extra parentheses allows ...


1

I had the same issue and it was resolved by changing the translations.php file as indicated in this post on the official DB Abstraction forums. The following code: // Check for true offset if ( count($limit_matches) == 5 && $limit_matches[1] != '0' ) { $true_offset = true; } elseif ( count($limit_matches) == 5 && $limit_matches[1] == ...


1

It appears that you're intending to redirect the user to a certain page, after the user posts a comment? If so: why are you hooking into get_commenet_link for this redirect? The get_comment_link() function is intended to return the permalink to a given comment. The get_comment_link filter is intended to filer the comment permalink returned by ...



Only top voted, non community-wiki answers of a minimum length are eligible