Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 73

A function is a sequence of program instructions that perform a specific task. It is packaged as a unit that can be used wherever the according task should be performed.

9
votes
You don’t have to remember very much. Any decent IDE will help you with auto-complete and an overview of the parsed PHPDoc. Example from Eclipse: After typing add_ you get a list of matching funct …
answered Jan 26 '13 by fuxia
1
vote
You create that string with $classes[] = $teaser_column . ' teaser'; Use the following instead: $classes[] = $teaser_column; $classes[] = 'teaser';
answered Dec 28 '13 by fuxia
2
votes
You get the $content as a parameter for your function, and you should not echo anything in that function. Return a string instead. Example: add_filter( 'the_content', 'app_bits'); function app_bits …
answered Oct 19 '12 by fuxia
0
votes
You can ask for roles with current_user_can() too: current_user_can( 'administrator' ) or current_user_can( 'editor' ) There is no built-in role moderator.
answered Apr 30 '13 by fuxia
2
votes
You can just add a check: if ( ! empty ( $post->post_parent ) ) { $parent_title = get_the_title($post->post_parent); echo "<h1>$parent_title</h1>"; } or use setup_postdata(): setup_postdat …
answered Apr 7 '14 by fuxia
5
votes
No, it will fail. There are literally thousands of mobile clients, and not all send a usable User-Agent header. There are better ways to adjust the site to small screens (which is not necessary the sa …
answered Nov 20 '12 by fuxia
2
votes
The action is called without any variables: do_action('admin_notices'); So you don’t get $error_token and $error_tag.
answered Feb 16 '12 by fuxia
8
votes
Use the second parameter of edit_post_link(), the before parameter: <?php edit_post_link( 'Edit', 'string of text: ' ); ?>
answered Feb 1 '14 by fuxia
4
votes
You cannot do that with pure PHP, because the fields are fetched from existing fields, and there is no hook. But you can use JavaScript, check if the post type supports custom fields and the field doe …
answered May 4 '13 by fuxia
1
vote
the_post_thumbnail() prints the HTML immediately. Use get_the_post_thumbnail() instead to get the HTML into your string. $content .= '<div class="thumbnail">' . get_the_post_thumbnail( null, "ho …
answered Mar 30 '13 by fuxia
1
vote
You can use a built-in function from WordPress: add_filter( 'woocommerce_is_sold_individually', '__return_true' ); This line in a separate plugin will set the value always to true.
answered Oct 16 '13 by fuxia
5
votes
A rather safe way is marking your local environment as such in your local wp-config.php. Example: // wp-config.php define( 'WPSE54453_IS_LOCAL_SERVER', TRUE ); // functions.php defined( 'WPSE54453_ …
answered Jun 7 '12 by fuxia
4
votes
Yes, you may add as many actions to the hook as you wish. Just try it.
answered Jan 11 '11 by fuxia
1
vote
I am afraid this is impossible. The markup is hard coded in /wp-includes/class.wp-scripts.php: if ( $this->do_concat ) $this->print_html .= "<script type='text/javascript' src='$src'></script>\n" …
answered Oct 23 '12 by fuxia
3
votes
Use strtok(): return strtok( get_the_title(), ',' ); You could also use my function utf8_truncate(). This is a little bit more flexible and it can handle long strings without a comma.
answered Oct 23 '14 by fuxia

15 30 50 per page