The tag has no wiki summary.

learn more… | top users | synonyms

-1
votes
0answers
13 views

Is WordPress css affecting the height of an embedded object?

I am embedding the following object (it's a website) on a WordPress page: return '<object type="text/html" data="' . add_proc($proc) . '&skey=' . $sessionKey .'" style="width:100%; ...
1
vote
1answer
37 views

How to get media objects

I am busy with a loop to return all media in the medialibrary in objects. I figured out how to get the images ( with wp_get_attachment_image('$mediaID') where the $mediaID is the id of the image ) ...
0
votes
1answer
32 views

Same taxonomy for different object types

Starting with WP 2.3 we can do this: register_taxonomy('custom_taxonomy', array('user', 'post', 'link', 'comment')); Those are different object types that belong to different tables and hence can ...
0
votes
1answer
31 views

Get object for a few selected taxonomies

I have some custom taxonomies that I would like to use as an object in a foreach loop. I know these functions which returns the object for either all taxonomies: global $wp_taxonomies; or the ...
1
vote
1answer
39 views

array of objects to do_action, callback gets singular object?

So I was passing an array of objects through an action today, no biggy, and things were working fine. Until I was iterating over one of the arguments to a callback and started getting errors. The only ...
-1
votes
1answer
33 views

Populate Array with values from another arrray [closed]

I have retrieved WP_Post object and i stored it in a variable. Array ( [0] => WP_Post Object ( [ID] => 45 [post_author] => 1 [post_date] => 2014-03-10 14:22:01 ...
0
votes
0answers
79 views

Sort taxonomies in select dropdown with topmost parents as optgroups

I have an array of objects with custom taxonomy terms. This taxonomy represents a list of countries/states/cities which are being used by a certain post type and other parameters (I'm not using a ...
0
votes
1answer
42 views

Why function hooked using object are executing at all time?

I tried to use class and object in plugin. I made a simple function with a shortcode but it is executing the function without pasting the shortcode to any page/post. class example{ function ...
1
vote
2answers
127 views

The ideal place for storing persistent PHP objects

I'm writing some plugins that do background batch processing, i.e. operations that take longer than 30 seconds. I'm creating objects with the necessary job parameters set like this (this is a hugely ...
0
votes
1answer
145 views

Does this function wp_get_nav_menu_object check if a nav menu exists or is supported?

function wp_get_nav_menu_object( $menu ) { if ( ! $menu ) return false; $menu_obj = get_term( $menu, 'nav_menu' ); if ( ! $menu_obj ) $menu_obj = get_term_by( 'slug', $menu, 'nav_menu' ); ...
0
votes
0answers
140 views

How to handle cookies from a WordPress plugin on a cached page?

I'm attempting to write a plugin that can work with cookies on a WordPress site that uses page caching (why?). I've been following this tutorial on Esanctuary.net. I'm trying to write to the ...
0
votes
2answers
69 views

wp_nav_menu inside an object — how do I deal with fallback_cb?

I'm trying to create a class that allows me to generate a navigation menu. Here's a simplified version of what I'm using: class PJ_Menu { function make_menu() { $args = array( ...
0
votes
2answers
395 views

When/why does '$query->get( 'tax_query' );' return empty?

First the code: function itsme_better_editions( $query ) { if ( $query->is_category() && $query->is_main_query() ) { $query->set( 'post_type', array( 'post' ) ); ...
0
votes
1answer
177 views

Query set using tax_query with relation 'OR' modifies category object?

(Update: Please see the edits far below.) The code: function itsme_better_editions( $query ) { if ( $query->is_category() && $query->is_main_query() ) { $query->set( ...
2
votes
1answer
147 views

When to use 'get_category_by_path' vs. 'get_term_by' to get category object from `get_query_var( 'category_name' )`?

I'd like to retrieve the category object from the category name, using the public query variable category_name, via get_query_var( 'category_name' ): $cat = get_query_var( 'category_name' ); There ...
0
votes
1answer
36 views

How can I unhook this action that was added via $this?

This is in regards to the plugin Theme My Login, although the question may relate to any plugin. The author says he no longer uses the support forum, so I've come here. I'm trying to unhook the ...
0
votes
1answer
266 views

Best way to extends core classes in theme?

I need to add functions to my WP_User objects, to be used like this : <?php // in my templates : $user = new User($id); $user->sendHelloWorldEmail(); // in my functions.php class User extends ...
1
vote
1answer
706 views

Using several add_action with parameters inside a class

I'm creating a theme framework and using a class to initiate all basic function of the theme (adding theme support, menus, etc). I've got stuck when I tried to enqueue the scripts and styles though: ...
0
votes
1answer
137 views

<object data = … > </object> changes after I save a post

I'm trying to embed an interactive graph by using the code below, and it works great: <object data="https://www.desmos.com/calculator/wr4nht4qbp" width="800" height="600"></object> When ...
1
vote
2answers
525 views

Trying to get property of non-object “ wordpress ”

My WP theme got these notice on description menu function my code : http://www49.zippyshare.com/v/89513423/file.html /* Discription Navigation Menu, Credit to Christian Kriesi */ class ...
0
votes
1answer
59 views

Keeping Objects in Memory

I have built a WordPress plugin using classes. Each project class is created for a specific user. I want to do three things: Keep the project object in memory for that user between his or her ...
0
votes
2answers
491 views

Get plugin_dir_url() from one level deep within plugin

I've written several plugins using the structure : /plugins/myplugin/myplugin.php /plugins/myplugin/class/class-myclass.php So as to take advantage of OO and overall structuring my code From within ...
1
vote
2answers
547 views

Load comments per post on click with AJAX

I'm working on a theme that uses a slider to display blog posts. Beneath the slider is a pagination that displays like a timeline, with a date instead of a page number, calling the corresponding blog ...
1
vote
2answers
1k views

How to initialize $wpdb?

I have a .php page in the theme root to check the data of one CUSTOM form. After receiving this data I need to do a query in a custom mysql table, so I need $wpdb, but I can't use it directly (or ...
1
vote
1answer
162 views

Use post object from first query in second query

I have a post ID stored in a variable from my first query and I'd like to use that to highlight the post with the same ID in my second query, but it's not working. First loop: <?php if ...
2
votes
4answers
3k views

Get the object ID by URL

I have an URL (such as the URL /sample-page/), I need the corresponding object ID. How?
1
vote
2answers
274 views

Modify built-in post type properties

I have an unusual situation where I need to make the built-in post type 'page' non-hierarchical. I printed the post type object with var_dump(get_post_type_object('page')); die; and I got this: ...
0
votes
1answer
408 views

Retrieve IDs from custom field, count and display results differently according to count

The function below is inside a single post loop. I have an array of IDs in a custom field. Such IDs represent related posts. I'm using Advanced Custom Fields (ACV) plugin and I manage the custom ...
0
votes
2answers
76 views

Obtaining values from objects

This code works fine and returns two StdClass Objects for each of my two posts: $children = get_pages($args); foreach ($children as $cake=>$element) { $args = array( ...
3
votes
1answer
1k views

Using the media uploader in a custom plugin

As part as a widget I'm creating, I need the admin to upload an image via the widgets panel I have the following code under a new class <?php function form($instance) { $instance = ...
0
votes
1answer
226 views

w3 total cache - Object Caching 2165/2469 objects? [closed]

Site is: http://kremim.com WordPress 3.2.1 MS, buddypress,bbpress installed. wp_options have 333 records. But Object Caching 2165/2469 objects? Why 2000+ ? Debug: ...
1
vote
1answer
1k views

Get menu object from theme_location

I'd like to get a menu object from its theme location argument. My goal is to output separately the menu name and its items name, url and description. Example of what I'm looking for : $menu = ...
1
vote
1answer
483 views

TInyMCE object Tag stripped

I need to add the following object tag to a page <object id="myExperience" class="BrightcoveExperience"> <param name="bgcolor" value="#FFFFFF" /> <param name="width" value="648" ...
-2
votes
3answers
181 views

Plugin: Custom menu item problem

I'm using the following snippet to add a menu item: <?php add_menu_page( 'Foo Server', 'Foo Server', 'manage_options', 'foo-server', array('Class', 'method') ); ?> Fine, ...
1
vote
1answer
66 views

Is the object cached?

I have a function to instantiate a class to provide var access to other functions. function my_data(){ global $post,$the_data; $postid = get_the_ID(); $the_data = new MY_Class ( $postid ); return ...
0
votes
1answer
100 views

How to avoid repeatedly use the new statement to instantiate a class? [closed]

I have a Class with a lot of variables. To get a variable, I have to write this line in each function: $x = new MY_Class(); I guess there has to be another way? I tried: function my_data(){ ...
0
votes
1answer
210 views

Error of “Call a member function on non object” while var_dump get correct result

I got error of "Call a member function embed() on a non-object", but I can see the result of var_dump is an object. Please help evaluate the following code: This is the Class to create a picture: ...
2
votes
1answer
57 views

Is it a good practice to include custom options when registering a post type?

More of an open discussion than a question, really, because I know adding custom arguments to the post type object does work, but I'm wondering if it is technically wrong in any way. Basically, when ...
4
votes
2answers
1k views

Is it possible to change the attributes of a registered style or script before it fires?

I'd like to modify the properties of a registered style(or script - same applies) before it's been loaded. Right now i'm trying to modify a registered style just before it gets enqueued, so i can ...