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
157 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()
11
votes
3answers
812 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 ...
11
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 ...
7
votes
5answers
833 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
1k 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
444 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
475 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
424 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
175 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
528 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
1answer
169 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 ...
5
votes
2answers
385 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
150 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
116 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
151 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
2k 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
1answer
54 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
2answers
190 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
47 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
390 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
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
1k 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 ...
2
votes
3answers
121 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
1k 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
449 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 ...
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
170 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
1answer
628 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
2answers
730 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
73 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') ...
2
votes
0answers
142 views

Is there any plan for WordPress to handle retina support for the site content? [closed]

I see from browsing Themeforest that there are many retina ( HD ready ) themes available; and WordPress itself has retina standard icons for the backend too; but what about the content, both future ...
1
vote
2answers
87 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
218 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
377 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
158 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
440 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
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
276 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
17 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
41 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
204 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
82 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
461 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
85 views

How do I set a custom WordPress update repository?

I'm co-authoring a white paper on utilising WordPress as a foundation for a web-app, I would like to change the repository that the core WordPress updates from, the latest additions of automatic ...
1
vote
2answers
913 views

HowTo: Add Class to Sidebar Widget List-Items

The newest version of Bootstrap (v3.0) adds a new List Group component which has the following structure: <ul class="list-group"> <li class="list-group-item">Cras justo odio</li> ...
1
vote
1answer
612 views

How to override wp_insert_comment()

I am trying to override wp_insert_comment() (wp-includes/comment.php). I added the following lines of code in my functions.php file, located in my theme : add_filter('wp_insert_comment', ...
1
vote
0answers
80 views

Can I hook into wp_update_core outside of the admin?

I'm trying to bring some of the admin functionality to a custom front end in WordPress. Questions of security and pragmatism of this aside, is there an available hook to trigger wp_update_core outside ...
1
vote
0answers
90 views

How to return an array of posts with the comments template intact for each post [closed]

Has anyone run across a way to build a page of posts that includes the comments and discussion form(s) for each post inline with the list? I tried this a few ways today and found it quite difficult. ...