The tag has no wiki summary.

learn more… | top users | synonyms

12
votes
3answers
2k views

Modifying WordPress core files

Why? Sometimes an easy fix to altering the behavior of WordPress itself or a plugin could be to alter the files of the plugin or WordPress directly. When coming up with such an idea, the usual ...
12
votes
4answers
160 views

Why do some core functions get wp_ while others do not? What's the rule?

Is there some guideline or rationale behind why some WP code functions are prefixed with wp_ ? eg: wp_insert_post() vs. update_post_meta()
12
votes
3answers
2k views

What is the role and history of the $content_width global variable?

I just stumbled over a global variable called $content_width. It was new to me, so far I could see that it's used in themes, both the standard twenty ten one and third party ones. It looks like that ...
11
votes
3answers
848 views

Easiest Way to Create a Patch for Submission to WordPress Core?

I've submitted a few patches for WordPress core on Trac (one of which has been used) but every time I think about doing it I cringe because my setup for doing so is incredibly tedious. Can someone ...
7
votes
5answers
938 views

What are some reasons why you should not hack WordPress core files?

Often a quick solution to a problem, can be solved by hacking the WordPress core, that is changing the code that is WordPress itself. This is a very dangerous road to take! Don't do it, ever! You ...
7
votes
2answers
2k views

Looking for WordPress System Diagrams

I am looking for WordPress chart/diagram system design. I found only the template hierarchy diagram, but it's only part of the system. source: ...
7
votes
2answers
513 views

What's $object->filter for?

I keep seeing this pattern, and wonder what it's for, how WP uses it internally: if ( empty($post) ) { if ( isset($GLOBALS['post']) ) $_post = & $GLOBALS['post']; else ...
7
votes
2answers
496 views

Why does get_term() require taxonomy? Are term_ids not unique?

A related WPSE question asks how to get the term by specifying ID only, without specifying taxonomy. My question is more philosophical. Generally, stuff in WP core is there for a reason. I'm trying to ...
6
votes
1answer
228 views

Managing WP Core & Plugin Updates for Clients

I'd like to know how you go about managing WP Core & Plugin updates for clients? It's a service my web company would like to start offering but we are unsure of the best solution. Let me provide ...
6
votes
1answer
502 views

is it possible to replace the use of gd_lib with imagick or ImageMagick?

i'm looking around for a solution since weeks and can't make anything work yet. the problem is that my server is running debian/lenny and it's not supporting the bundled gd_lib which i need for ...
6
votes
2answers
198 views

How do I use the WP image functions in a page template?

Wordpress has tons of mature code for image editing on the admin side, but I would like to provide a form inside of a custom page template for my visitors to drag and drop, crop and save a thumbnail ...
5
votes
2answers
254 views

Passing a hardcoded page/post ID into `get_post`

I see people using this to pull in page content on their home pages, remove specific categories from archives etc.. e.g. $post = get_post( 5 ); Someone suggested this was bad practice. Why is it ...
5
votes
2answers
877 views

Are the wordpress Core css styles really all nessasary?

On WordPress Codex there are this CSS styles listed, its a quite big list of styles but it seems they are doubled unnecessary. It says: Each Theme should have these or similar styles in its ...
5
votes
2answers
485 views

Update to older wordpress version from admin?

I have a Wordpress 2.7.x setup that I would like to migrate to the latest version 3.2.1, however I need to make a stepped-upgrade as some plugins need an older version first (3.0.6 IIRC). However ...
5
votes
1answer
309 views

Slow wp_term_relationships query

I'm running a large WP instance (currently has 28,000+ posts in custom types) and have been experiencing some odd slowdowns. Upon analyzing the MySQL slow query log, one of the problem queries is: ...
4
votes
2answers
167 views

What is a “protected” post status?

I noticed in the register_post_status function in core that there is an arg for 'protected'. The following post statuses: 'future', 'draft', and 'pending' all have this set to true. I'm not talking ...
4
votes
2answers
157 views

How would I compare and remove hacks to core?

I have been put in charge of a site that have a lot (and i mean it) of core hacks, some are pretty easy, some are really hard to spot (like removing a do_action on the_content. So, my question is , ...
4
votes
3answers
2k views

$GLOBALS array for wordpress

is there a file where wordpress defines it's $GLOBALS? i'm just curious as to what wordpress uses it for and for what purpose. That's all!
4
votes
5answers
3k views

Change the login button on the login page

I would like to be able to change the text on the Log In button in wp-login.php - however, it's a bit more complicated than that. I want to be able to change it in the theme, rather than editing the ...
4
votes
2answers
261 views

Rewriting a core function?

As I understand it, it's possible to overwrite core functions in wordpress, without touching the core itself, which is of obvious benefit. Now, certain functions are 'pluggable', but not all of ...
4
votes
1answer
72 views

Why are double-periods (“..”) invalid in a Wordpress image filename?

ms-files.php contains the following code fragment: $file = rtrim( BLOGUPLOADDIR, '/' ) . '/' . str_replace( '..', '', $_GET[ 'file' ] ); if ( !is_file( $file ) ) { status_header( 404 ); die( ...
4
votes
1answer
50 views

What is the purpose of this line of code in wp_trim_excerpt? [closed]

Can someone please explain what the purpose of this code is: $text = str_replace(']]>', ']]>', $text); I'm referring to a line of code inside wp_trim_excerpt(), but I've seen something very ...
3
votes
1answer
410 views

How Does Wordpress Uninclude/Deactivate A Plugin?

Wordpress uses the Observer Pattern for its plugin system and operates on the premise of checking if a plugin is activated, scanning the plugins directory and storing everything in an array in the ...
3
votes
3answers
3k views

“Unexpected error” on update requests

It needs connectivity to wordpress.org and is timing out. I am behind a corporate firewall. I have never had this issue come up before in previous versions. Why does themes.php need access to ...
3
votes
1answer
694 views

Changing subdir multisite install to subdir core directory structure

Now that WordPress 3.5 is supposed to work with core files in subdirectory, I decided to move my local development setup (subdirectory multisite) to that configuration. Fast forward and what I have ...
3
votes
3answers
2k views

Loading template files from a subfolder in my theme?

I am working on a site that will have up to 30 templates in it. I don't want to have all those templates at the root of my theme folder cluttering up everything. I know how I can modify the ...
2
votes
3answers
151 views

How to disable core and plugin updates

Is there any way to disable core and plugin updates? I am modifying a plugin and bit of WordPress Core (I know its a sin to do so), but can't help it.
2
votes
2answers
2k views

Updating Wordpress - the best approach (updating wp core, plugins and db)

What is the best approach (steps) to update Wordpress when I have to update all of the following: wp core plugins database I came across this post http://codex.wordpress.org/Updating_WordPress ...
2
votes
1answer
935 views

How to disable `SQL_CALC_FOUND_ROWS` [duplicate]

Possible Duplicate: wordpress query causing load In the site I'm trying to optimize, I noticed several queries that are rather slow and start with SELECT SQL_CALC_FOUND_ROWS Searching this ...
2
votes
1answer
38 views

How can i know when i can execute what functions of wordpress?

I like to do a bunch of stuff only on homepage and archive pages i am working with the genesis framework (not really matters i guess) if( is_singular() ) { wp_die('functions.php'); } ...
2
votes
1answer
232 views

What is <# code #> in media-template.php, and how does it work?

I'm checking /wp-includes/media-template.php and just found this: <# if ( data.compat && data.compat.meta ) { #> {{{ data.compat.meta }}} <# } #> Never seen <# #> or ...
2
votes
2answers
803 views

Replacing the default content created while the site creation

How do you replace the default title for first comment? Mr WordPress on Hello world! I could not able to locate this in theme's comments.php file I want to edit the title 'Mr wordpress on Hello ...
2
votes
1answer
87 views

What's $GLOBALS['wp_settings']['media']['embeds']?

In wp-admin/options-media.php, there are a few lines that go: <?php if ( isset( $GLOBALS['wp_settings']['media']['embeds'] ) ) : ?> <h3 class="title"><?php _e('Embeds') ...
1
vote
2answers
111 views

Find out if there is a available core update?

I want to set up a function that notifies me when a core update is available. But i can't find any functions that check for updates. I have looked at list_core_updates() and it may be possible to ...
1
vote
2answers
72 views

Why use while over if in single wordpress posts?

Why is while() used instead of say if() here: <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'single' ); ?> <?php ...
1
vote
2answers
354 views

Clarification on filters and hooks

I am about to start my first WordPress project and I have the task of moving customized core code that override the core into separate functions/files (this way it'll be easier to maintain when we ...
1
vote
1answer
434 views

Add More Fields to Users Pages (Admin Panel)

So I'm trying to create some custom fields for users. I need to give users access to a 30 day trial of some software and I want to keep track of that in the users page of administration panel. If the ...
1
vote
2answers
177 views

How do I implement a .diff changeset from core.trac.wordpress.org locally?

I have a local copy of the latest version of wordpress that I set up using svn co http://core.svn.wordpress.org/trunk/ There is a diff that I want to pull into my local fileset: ...
1
vote
2answers
498 views

Changing the comments link produced by the get_comments_link() and get_comments_pagenum_link() functions

Currently my theme calls upon get_comments_link() to create the standard anchor #comments to link to the comments below the post, as does the get_comments_pagenum_link() function on paginated ...
1
vote
1answer
71 views

Changing a WordPress core function without hacking core

I am looking to change one line within a core function. The function is wp_allow_comment() located within /wp-includes/comment.php function wp_allow_comment($commentdata) { global $wpdb; ...
1
vote
1answer
84 views

What's the purpose / logic of split_the_query in WP_Query->get_posts

In the get_posts method of WP_Query, there's a section relating to split_the_query The logic of split_the_query is $split_the_query = ( $old_request == $this->request && ...
1
vote
2answers
2k views

How do I fix this error: Warning: invalid argument supplied for foreach()?

I recently moved a wordpress install from my local instance to a dev server. For the move, I installed a clean version of wordpress 3.4, moved exact duplicates of the file structre, and used the ...
1
vote
1answer
284 views

In what part of the Wordpress core does the users table and usermeta table get joined?

I have been trying to work out just where in the massive jungle of Wordpress include classes the usermeta table is joined onto the users table and if so, how does it work? The one confusing thing ...
1
vote
1answer
228 views

Conditional tag is_page with a custom post type

Accordingly to the is_page documentation, supplying the slug as an argument WP can tell me whether the current page is the one represented by the slug. Perhaps I am using the wrong slug? However I ...
1
vote
1answer
99 views

Extending WP_Widget throws error when Monster Widget used

I wanted to override the output for the core Recent Comments Widget. I extended WP_Widget_Recent_Comments made the changes needed and it displays exactly how I want. However, I have now tested the ...
1
vote
1answer
83 views

Is this plugin being loaded before file.php, subsequently not allowing me to use certain functions?

I'm trying to use get_home_path() in my plugin, however, I get a call to undefined function fatal error (running Wordpress 3.8). I believe this would imply that my plugin is being loaded before ...
1
vote
1answer
415 views

Loading WP core Thickbox through frontend

Looking through some of the top Google results, this question has been answered a number of times, but the answers given don't seem to be working in my WP 3.6 install. One solution given is this: ...
1
vote
1answer
97 views

Conditional hook based on the core function that is calling it

In a Multisite, I'm applying the filter get_blogs_of_user to sort the "My Sites" admin bar menu, where the sites are listed by blogname: What happens is that I'd like another order elsewhere, where ...
1
vote
2answers
468 views

error: An Unexpected HTTP Error occurred during the API request

I'm using wordpress version 3.1 and if I try to upgrade any plugin on any of my sites I get the error message error: An Unexpected HTTP Error occurred during the API request. Not by upgrading ...
1
vote
0answers
83 views

Wordpress 4.0 Media Gallery (Same Image) Bug - Does anyone know how to fix this? [closed]

So, we've been working on this site for a long time and have finally started finishing up. As a last cleanup we updated all our plugins and Wordpress to 4.0 and expected awesomeness. However, for ...