The tag has no wiki summary.

learn more… | top users | synonyms

5
votes
2answers
2k views

BLOG_ID_CURRENT_SITE vs. SITE_ID_CURRENT_SITE in WordPress Multisite?

I've been trying to figure out why we have the constants BLOG_ID_CURRENT_SITE and SITE_ID_CURRENT_SITE (vs. hardcoding them to be equal to 1), what exactly the differences are, and when either of them ...
2
votes
1answer
181 views

What should I use instead of WP_CONTENT_DIR and WP_PLUGIN_DIR?

The WordPress documentation for Determining Plugin and Content Directories states that: WordPress makes use of the following constants when determining the path to the content and plugin ...
2
votes
1answer
391 views

Use theme constants in plugin?

I'm creating a plugin version of the Roots Theme function additions - to make it a bit more portable, but have run into a snag. Part of what Roots does is add htaccess rules based on the current ...
1
vote
2answers
1k views

Turn Off Automatic Trash Deletion?

I have a client who wants to use the trash feature, but keep items in there indefinitely (I have no idea why, but they insist on it). From reading this codex article on the trash status, I see that ...
1
vote
1answer
114 views

wp_enqueue_script & constants?

I'm enqueuing a script: wp_enqueue_script('my-script', MY_SCRIPTS."/my-script.js"); How to get MY_SCRIPTS const working in this context? I know this works: $template_dir = ...
1
vote
2answers
699 views

Accessing site's root from themes folder

Having some troubles with a PHP script I am trying to build. I need to access the a file which is located in the root folder of my Wordpress install: wordpress-root/live-config.php Problem is, my ...
1
vote
1answer
835 views

Using the ABSPATH constant - What files need to be loaded before use?

I need to make use of the ABSPATH constant but need to know what WP files I need to include so I can make use of it. Thanks a lot!
0
votes
1answer
70 views

get plugin directory url

I am trying to use SMOF Options Framework in a plugin and i have this problem. SMOOF use this constants to get theme directory url: if( !defined('ADMIN_PATH') ) define( 'ADMIN_PATH', ...
0
votes
1answer
36 views

Update the value of a constant

I have a file containing all the constants used in the plugin. For example, I have a variable in one of my file define('APPOINTMENTS_DEFAULT_ENABLE_PAYPAL', 1); I have a checkbox in admin area where ...
0
votes
2answers
591 views

Synchronizing Two WordPress Sites Content

I've googled a lot, and I do have found answers at WordPress SE and at stackoverflow.com. However, the answers are somewhat incomplete or doesn't work at all. Here I'll explain my problem in detail, ...
0
votes
2answers
390 views

How can I append blog_id to … echo [functions-defined-constant]?

I use 'constants' a lot. I set them in functions.php like define('mytheme_town', 'Orlando'); and then call them into the theme <?php echo mytheme_town ; ?>. It's simple and easy. But I need ...
0
votes
1answer
24 views

Calling directories to load in wordpress

I have a wordpress install, with two sub folders "assets" and "functions" these folders contain important files for the wordpress theme. What would be the best way to load these files I've tried ...
0
votes
1answer
163 views

Get WP Install Directory

I have a theme which - I was quite proud of myself! - I designed to be installed in wp sites where wp is on root level. Then half my users installed the theme on a mysite.com*/wordpress/* ! ...and ...
0
votes
1answer
189 views

Get variable value based on string constant

In my plugin I define a constant as follows: define('DEFAULT_NUM', 5); I also define a constant representing the name by which I want to refer to this number: define('DEFAULT_NUM_NAME', ...
0
votes
1answer
172 views

Many Single Sites, One Plugin directory - adjust plugins_url()

[this is not a Multisite question] Update: this question is a logical impossibility, or a mind loop if you will, check update bellow. The technique is laid out here in WPEngineer. It allows ...
0
votes
1answer
366 views

ABSPATH in Windows

I'm having a a pain in the head using the ABSPATH constant in Windows. Addressing files and folders in Windows is usually done using the \ (forward-slash) character while for Linux the character would ...
0
votes
0answers
44 views

Notice: Use of undefined constant - assumed ' '

I turned on debug mode and see the following in my header: Notice: Use of undefined constant - assumed ' ' I'm using the following function in header.php: <?php if ( is_user_logged_in() ) { ...
0
votes
0answers
67 views

Making Site A Use Site B's wp-content Folder

I'm trying to synchronize two WordPress sites and on my way I've faced few challenges. One of the challenges is to either synchronize the wp-content folder of two sites or make one site use the ...
0
votes
1answer
108 views

Define constant for one plugin in mu-plugin

I'm trying to define the constant ACF_Lite as true so that the interface of the Advanced Custom Fields plugin is hidden on all of my multisite subsites except the parent. For clarity and ...
0
votes
1answer
57 views

Can't Access Constant from within Included File

First of all, I'm completely sure I'm being an idiot on this one - but an hour of scratching my head and searching this site has still left me perplexed. I'm trying to access a constant that's ...
0
votes
1answer
73 views

Insert functions-defined constant into get_tags code

I'm using the below code from WordPress' get_tags Function Reference page $tags = get_tags(); $html = '<div class="post_tags">'; foreach ($tags as $tag){ $tag_link = ...
-2
votes
2answers
153 views

Checking for existence of constants before defining them

I am seeing many plugins use the following format for defining their constant: /* Set the constant path to the plugin's javascript directory. */ if( !defined( 'MY_ETS_JS' ) ) define( 'MY_ETS_JS', ...