1
vote
1answer
46 views

What's the point of using Wordpress's built in admin-ajax.php?

I'm trying to understand why using admin-ajax.php is advantageous over doing something like this: add_action ('wp_loaded', 'my_ajax'); function my_ajax() { // Do Ajax, Check $_POST die(); } ...
0
votes
0answers
17 views

Get site owner meta to show publically on front end in multisite? using “user meta shortcodes” plugin

I've searched all over for a fix and have had no luck. Im using the "User Meta Shortcodes" plugin to display user meta. The plugin works fine, the problem is that it doesnt output the meta info from ...
0
votes
1answer
114 views

Replacing select2 in admin backend for all selects

I originally posted this question as a javascript question here, but think maybe it would be better asked here. I tried adding select2 to all wordpress admin screens. However, since many selects are ...
0
votes
2answers
306 views

Display Custom Field Value on Admin Page Column

What I want is to display the value of the custom field called 'page_template'. I use the code below but it displays nothing under Page Template column although I have already defined a value for the ...
0
votes
2answers
1k views

How do I get the current edit page ID in the admin?

Most solutions I found are for front-end use. This is for a plugin, so the all activity is in the back-end. How do I get the page ID that's being currently use(edited) in the admin? Note I'm out of ...
0
votes
1answer
99 views

Custom colors for post rows based on post meta value

I'm trying to have the post background colors change depending on a meta value for the specific post type rather than using the post status. Looked everywhere and can't find a solution. (perhaps there ...
0
votes
1answer
319 views

Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?

Ok so here's the question how do i stop js from running twice on the widget.php page? I am creating a ajax loaded custom image selector from a domain on the same server as the current site. I want ...
1
vote
2answers
194 views

Exclude add_filter from the admin

I've created a custom filtering facility for a front end search, which also includes a specific user group. To add the function to the search I have used ...
0
votes
1answer
67 views

Custom post type isn't working

I just built up a beta environment for testing my new Wordpress site. I didn't migrate the database; I did my own installation again and ported over my theme (it's a simple theme) to my new instance. ...
1
vote
1answer
135 views

echo or print_r in an admin function

I'm currently working my first plugin (to deal with my CPT) and am at the process of saving the values of a meta box. I wish to add an underscore (_) to the meta key so that it is hidden on the ...
1
vote
1answer
222 views

How to Display Frontend CSS for Administrator only

I've been asked to restyle the css of a WordPress website frontend. The website can't be in maintenance mode while working on it as it must stay up and running all the time. I assume that if I can add ...
0
votes
1answer
116 views

How to add an admin function only to posts, not pages?

I'm having a problem with adding an excerpt counter to the excerpt field. It may be a conflict with another plugin, but basically it screws with other jquery if the excerpt field doesn't exist (e.g.: ...
0
votes
1answer
168 views

Adding a 'style=' bit to image_send_to_editor output

The best thing I liked about the new v3.5 media manager was being able to insert images to a post hosted by an external site like photobucket using "Insert from URL". I normally format my image ...
0
votes
1answer
290 views

Function to add custom HTML into head in custom post-type list page

How can I add custom HTML/PHP file into head where custom post-type list showing like this ? Any Wordpress function can do this ? or I can only do by JS(jQuery) to append my custom content ?
0
votes
1answer
125 views

function to return comma separated list of meta values

I'm customizing the admin edit.php screen and I have a column that displays a meta key $gear. But it only lists the first value instead of returning a list of all the values. Here's the bit that ...
0
votes
1answer
69 views

Screen Options Wordpress WYSIWYG

Is there any way to set a checkbox for WYSIWYG box in this options so admin is able to hide it in case there's no need for content in a page
1
vote
1answer
36 views

How to select a page within admin?

How does one apply an action to one particular page within admin? I've added a bunch of wysiwyg editors to one page ("Home") and now I don't need the main editor. But the function below - of course - ...
5
votes
2answers
1k views

Modify Admin Bar Link

Starting on line 474 of /wp-includes/admin-bar.php there is a function that is declared as the following: function wp_admin_bar_new_content_menu( $wp_admin_bar ) What it does it generates the + New ...
1
vote
1answer
748 views

Can I remove the Rich Text box editor for a specific post?

A few months ago I asked a similar question: Is it possible to remove the main rich Text box editor? and got the following answer: function remove_pages_editor(){ remove_post_type_support( ...
1
vote
1answer
169 views

Hard-coding custom menu elements for menu manager

I realize that one can add custom links through the menu manager but is there a way to manually create such components through the functions.php file? More specifically, one example here relates to a ...
0
votes
1answer
446 views

using admin functions on frontend

I'm updating my plugin to rely on internal functions of WordPress. I'm about to use wp_generate_attachment_metadata, but this function seems to be only available in the admin section. Is there an ...
1
vote
1answer
3k views

Is it possible to remove the main rich Text box editor?

I am using the simple fields plugin to provide additional rich text editors and have no need for this 'main' text editor box on any of my 'page's I have tried the following code in my functions.php: ...
5
votes
3answers
2k views

Change admin bar to default:off

While I quite like the admin bar I actually want it to be OFF by default instead of ON ( I don't want to disable it altogether because I want users to be able to turn it on if they want - but but I ...
3
votes
2answers
1k views

How do I remove a require_once admin panel from the parent theme from the child theme functions.php?

In the parent theme, the following is at the bottom of the functions.php file. require_once(TEMPLATEPATH . '/admin/admin-menu.php'); In the child theme's function.php, this code will include the ...
2
votes
1answer
1k views

How to remove row-actions from pages table?

I've already found out here how to remove the row-actions from the posts table in wordpress admin. Now I'd like to do the same in the pages table. I've looked in the core files but, well, I just don't ...
3
votes
2answers
810 views

Modify CSS via Theme Control Panel

Hi to all I'm trying to create an advanced control panel for my first Wordpress template but I'm not able to add a function that I will need. The function that I'm trying to add is the possibility to ...
1
vote
3answers
2k views

Make sub menu items a main link in the admin menu using fuctions.php

I am trying to customize the admin area using the functions.php file to make things easier for my clients. One request I have got before and hope to be able to accomplish, is to move some of the sub ...
1
vote
1answer
872 views

$user_id vs. is_user_logged_in()

I found a code scrap on the internet which uses if($user_id) { instead of if ( is_user_logged_in() ) { to check if the user is logged in. I would assume that the first would be slightly faster ...
0
votes
2answers
311 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
51 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. ...
1
vote
1answer
1k views

Help extending custom drag-drop page ordering on admin page list screen

I am utilizing the following code which transforms any hierarchical page or custom post type with the ability to reorder the the pages through simple drag/drop. (also this code also adds a new display ...
215
votes
108answers
98k views

Best Collection of Code for your functions.php file [closed]

Please vote on the question and any answers you find useful by clicking on the UP arrow on the left hand side of the question or answer. As with many others who are now viewing this post, I have been ...