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.

learn more… | top users | synonyms (2)

0
votes
1answer
502 views

Help with WP Business Directory Manager Plugin?

I'm using the WP Business Directory Manager plugin and I'm having some problems. The developer hasn't been supporting the plugin lately, so here I am. I need to change the field order. Currently the ...
2
votes
1answer
631 views

Convert User ID's to User Names in a single.php file

I have a post_meta "thevoters" that store users ids like: 1,2,20 ...etc, How i can turn this id's to User Names to list them in a single page? This will echo the numbers as text, echo ...
1
vote
1answer
330 views

Move Post to different category if post_meta field is 0 or is 2 days old?

Is it possible to move a post to an another category if post_meta field is 0 ? I'm building a reverse order vote, every post have by default 10 votes and after a user vote, removes one vote by ...
0
votes
2answers
323 views

Return User Meta text as links to post edit inside the user columns

I use this function to get some information to the user columns, function column_company( $defaults ) { $defaults['usercolumn-company'] = __('Company', 'user-column'); ...
0
votes
1answer
355 views

WP 3-way voting system: On to something! Please help!

Okay I posted a question yesterday, that can be found here. I've found some code on the wonderful internet that I think is really the ticket for me, but I don't know how to develop into what I really ...
1
vote
2answers
218 views

Is there a wordpress function that I can use to retrieve the current page that is loaded?

Suppose that I create a page in the admin section (under 'Pages') and I have permalinks turned on and this pages slug is 'my-new-page', then is there a WordPress function that will work outside the ...
0
votes
1answer
65 views

How would I got about calling a php file every time someone publishes a new post?

I've got a custom php file that I want to call every time someone publishes a new post. How would I go about doing that? Can I write it into the functions.php of my theme?
0
votes
1answer
55 views

What is the most efficient way of adding additional functionaliy for admin only

I'm trying to figure out the best approach to add additional functionality that will only be utilized by admins via /wp-admin. What's the best way to implement so that resources aren't being wasted. ...
0
votes
2answers
429 views

fetch images and videos

Is it possible to fetch videos and images of a particular website and put it into post? i mean i am thinking of writing a function, where i will just write the website name, and then with the help of ...
1
vote
1answer
494 views

Event Calendar using insert_post_data after save_post and insert_post after post_transition draft_to_schedule

OK, I'm taking on the dreaded task of developing an event calendar for my site and have gotten a bit stuck. I'm open to any and all ideas but here's what I'm doing and what I'd like to do. I'm ...
0
votes
2answers
454 views

What is wrong with this Shortcode? I get it in a wrong place inside the content

Hi to the community, i try to build a shortcode that prints the Creative Commons logo and some text, everything is working fine except that i put the shortcode at the end of the post but the shortcode ...
0
votes
2answers
2k views

Change labels on 'Nickname' and 'Biographical Info' in user-edit.php

For a project I'm working on, I want to change the labels of the 'Nickname' and 'Biographical Info' fields on edit profile (user-edit.php) page in the dashboard. I still want to use those fields as ...
0
votes
2answers
2k views

Are there action hooks for comments?

This is for a personal-use plugin I'm trying to make. I want to submit a comment from site A to my blog (sort of like sending trackbacks/pingbacks but a full comment). For instance, on site A I have ...
1
vote
2answers
400 views

VERY new to coding - keep breaking site trying to add to functions.php

I really appreciate everyone on this site who takes the time to answer questions here. I've learned a good deal already reading, but am sure I could learn even more if I could get past at least one ...
1
vote
2answers
620 views

Run functions only in the admin area?

I'd like this code to only run inside the admin area as it is resorting the items on the public side admin bar too. /* Reorder Admin Menu to put "Pages" at the top */ function ...
0
votes
1answer
191 views

shortcode help require

i am having a wordpress function to display the latest 5 tweets of the user, this tweets can be displayed by two ways one is through direct entering the user ID in admin menu which i created, and ...
0
votes
1answer
1k views

get_post_meta() problem again

i asked this question previously, which solved my problem, but further i am having still problem with it, i have a function to display tweets of a user which fetch from a custom field, the custom ...
1
vote
1answer
2k views

echo get_post_meta()

this is a silly question, but i dont know, can anyone help me out in this i want to echo get_post_meta() on a url, but i am getting parse error i am having a function, where in the between of url one ...
1
vote
1answer
1k views

post to subcategory and parent in wp_insert_post

this code works fine. the problem i have is that when i submit it only checks the parent category not the subcategory even though i specified both a parent and a subcategory. please. what am i doing ...
1
vote
2answers
383 views

write in functions.php

i just want this code to be added in my functions.php, so that it will directly display after my post ends currently i am adding this code to my single.php, but i want to add this is in functions.php, ...
3
votes
1answer
4k views

How do I make my function add variables/values to the $post object?

How do I add $tzDesc and $tzEmbed (and other variables) to the $post object in the following function so that I can display the values in my theme files by inserting <?php echo $tzDesc; ?>? ...
0
votes
1answer
499 views

Update users custom profile fields

Ok guys, i have problem when using some trics from here or other sites. Im trying to use this method of adding custom user fields. But, when i add this, everytime i save its all ok, but when i come ...
1
vote
2answers
493 views

How to let a single post have its own domain name

I am not sure which solution here would work best as a solution but what I am looking for is just a simple way to enter an optional domain through a metabox on the page edit screen and then just ...
2
votes
3answers
678 views

wp_enqueue_script + how to load JS or CSS in one URL merge call?

Is there any proper wordpress way of including the JS and CSS through one merged URL? So that instead of loading in x number of separate calls for each JS asset, it can be all merged into one URL? ...
1
vote
2answers
255 views

greatest() function returns undefined property

I'm using the mysql GREATEST() function to compare two table fields and display in a loop either one with the highest integer value. The 2 fields consist of vote scores for posts: UP or DOWN. ...
0
votes
1answer
3k views

simple wp_insert_post example

i've spent way too much time trying to use the wp_insert_post() function a <form> and i do not know why it is not working. // Create post object $my_post = array( 'post_title' => 'My ...
0
votes
2answers
381 views

Check if variable is set in filter

Thanks to your suggestions, I enabled wp_debug and discovered flaws with my plugin. I have a filter for sorting posts by votes. I use it when the sort URL parameter is on. add_filter( 'posts_where', ...
1
vote
1answer
1k views

add_query_arg not working

I added a filter to append a parameter onto the URL when navigating in categories. This is used to sort posts by their votes when browsing a category only if a sort parameter is set. For instance ...
3
votes
1answer
581 views

Roles & capabilities GUI that does not create separate table

After reviewing plugins that deal with user roles and capabilities I concluded that I might be better off just hardcoding my settings into my functions.php file. This actually worked out well for me ...
0
votes
1answer
743 views

SQL error with custom query

I'm trying to create a custom post query for sorting posts that have been voted "thumbs up". I'm joining my custom "wp_post_votes" table (which stores the number of votes each post received) with ...
2
votes
1answer
452 views

Wordpress change author email notify message?

just want to change a little bit author email notify message(wp_notify_postauthor - pluggable.php),and I'm applying filters on comment_notification_text function myfunction(){ return "<div ...
1
vote
1answer
459 views

How to list all images in uploads directory except those that are attached to any post

I've got code in my functions.php which parses the WP uploads folder and lists all images it finds there. Is it possible to place a filter here that would exclude any image that is already "attached" ...
1
vote
1answer
112 views

Author Tracking Code!

I need help with coding this piece. Basically i want with someone click on my author page. It stored a cookie of that author name and email. I want the cookie to stay in place untill the person close ...
2
votes
3answers
525 views

Link Category Description

I'm pulling my hair out over this. In the Links manager, you can enter a description for the category (in addition to the link itself). However, in wp_list_bookmarks, there is no way to call this ...
2
votes
2answers
582 views

Set user loggin status?

I create user with wp_create_user,after succesfully creating a user I need to set his status to be logged in?How to set his status to be logged in ?
0
votes
1answer
404 views

Add array of post id's to a category?

Is there a function to add array of post id's to a category,something like this array(2,3,5,6) to put in some category,not looking for update post. Tnx in advance.
1
vote
1answer
199 views

Function returns different value when called from 'save_post' than when called on page load

The "word_count" function below returns different values depending on where its called from. Why? add_action('save_post', 'my_custom_save', 10, 2); function myPlugin($post) { global $rockScore; ...
1
vote
1answer
535 views

How to pass data from page to widget functions?

I need help,need to pass data from page,to widget function,I need to pass author id to widget,any idea? Tnx
0
votes
1answer
354 views

Get urls of images in a gallery?

I need to retrieve the URLs for the images inside a gallery, what's the appropriate SQL query for this, based on the post ID? I currently have something like the following which I found on via ...
1
vote
1answer
104 views

Should everything in functions.php be hooked or filtered?

Considering how often functions.php is called, shouldn't all of its contents be hooked or filtered into core WP functions like init?
1
vote
1answer
625 views

How often is functions.php loaded?

Trying to get my head round functions.php and am wondering how often it is loaded?
0
votes
3answers
1k views

Removing Unnecessary Text from Admin Menu without CSS

I am looking for a way to remove all the unessesary text from default worpdress metaboxes. Preferably I would like to ensure that the content is not just hidden through CSS but actually removed from ...
0
votes
1answer
130 views

Defining the value of a variable before a function?

I'm trying to edit a plugin so that it only shows it's submenu if the user is an administrator but I don't know how to define the value of the variable before the function: function load_view( $name, ...
1
vote
1answer
93 views

How to display html in only the first level of WP comments?

How would I display html code in only the first level of threaded comments? Example L1 Comment ----L2 Comment --------L3 Comment L1 Comment I have a piece of html code that contains basically reads ...