php – Pending Comments – WordPress Development Stack Exchange

get_comments () will receive comments for you, either from anywhere in a blog or for a specific post. Your arguments are documented at WP_Comment_Query :: __ construct (),

Unless you have a plugin installed that will be added Pending As comment status you are probably looking for something like this:

$ args = array (
// Restrict comments to a specific post.
// Leave this option disabled if you want to have all comments blog-wide.
& # 39; # 39 & post_id; => $ post_id,
// Get only unapproved (ie pending) comments.
& # 39; status & # 39; => & 39; hold & # 39 ;,
// gets only comment IDs.
// If you want complete comment objects, leave this option disabled.
"Fields" => "IDs",
);
$ comments = get_comments ($ args);

If you to have installed a plugin that adds Pending As a status you can try it & # 39; status & # 39; => & # 39; pending & # 39; instead of & # 39; status & # 39; => & # 39; hold & # 39;, since the status Argument allows custom status.

WooCommerce Fundraising Affiliate Sales – Exchange WordPress Development Stacks

I'm trying to find a solution that allows members to sell products on behalf of multiple organizations.

In our case, there are several organizations with their own members. Members sell our products during their fundraiser on behalf of their organization. For example, imagine Girl Scouts selling cookies for their troop. In this example, we are the cookie company.

I am trying to find a solution where members sell products through our Woocommerce installation and receive credits for sale. A bit like a partner program.

Are there any recommendations?

node.js – development server disconnects when create -react-app runs locally

I am using the FireFox Developer Edition browser to run a React app with a node / express backend.

It works fine, but no changes are reloaded in the browser. I need to refresh the page to load the changes.

The console says:
`The connection to ws: // localhost: 3000 / sockjs-node / 079 / mv2n1gcm / websocket was interrupted while the page was loading. websocket.js: 7

The development server has disconnected.
Refresh the page as needed. webpackHotDevClient.js: 65`

Would like for the changes to hot reloading.

Many Thanks.

Theme Development – Move Wp_option change to all users without reloading them

I'm trying to use a custom wp_option to set a color theme for a custom template.

At the moment, I'm doing a meta update of a cycle. This is a fairly static site and will only be updated on mobile devices if the desktop is excluded.

I thought maybe a checker to see if the value has changed and update if true. However, I can not figure out how to do it without updating, since the if / else check would work.

Is there a way to move cron or the change. So, if an administrator changes the value, it will be reflected on all devices within a few seconds.

Sorry for formatting on the phone.

Web Development – Speed ‚Äč‚ÄčOptimization of HTML?

Edit .Php file, save, upload via FireZilla, refresh page -> ~ 2 sec. / Change

This is pretty fast, but with some changes like spacing, text and image alignment – it adds up. My website is hosted by DreamHost and calls CSS, JavaScript, CDNs and other external sources.

All in all, there is a faster way to see the results of an edit – such as an instant render application?

Plugin Development – Multiple Taxonomies and Permalink Structure

I'm trying to create a permalink structure with multiple taxonomies. I do not have much experience with WordPress, so I'm trying to find someone who will help me.

I just created permalink_structure (), and the link structure works fine, but I'm having trouble loading template files.

/ products / category / and / products / category / day / load the same file -> taxonomy-category-cat.php.

/ products / category / day / should load a separate taxonomy-category-tag.php file, but I do not know how to reach it.

My code:

Class products {
public $ post_name = & # 39; Products & # 39 ;;
public $ tax_name_cat = & # 39; products-cat & # 39 ;;
public $ tax_name_tag = & # 39; products-tag & # 39 ;;

public function __construct () {
add_action (& # 39; init & # 39 ;, [$this, 'create_post'] );
add_action (& # 39; init & # 39 ;, [$this, 'create_taxonomy_cat'] );
add_action (& # 39; init & # 39 ;, [$this, 'create_taxonomy_tag'] );
add_filter (& # 39; post_type_link & # 39 ;, [$this, 'permalink_structure'] );
}

/ **
* Initialize post type
*
* Return invalid
* /
public function create_post () {
$ labels = [
            'name'               => _x('Products', 'my-awesome-plugin'),
            'singular_name'      => _x('Products', 'my-awesome-plugin'),
            'add_new'            => __('New Product', 'my-awesome-plugin'),
            'add_new_item'       => __('Add New', 'my-awesome-plugin'),
            'edit_item'          => __('Edit', 'my-awesome-plugin'),
            'new_item'           => __('New Product', 'my-awesome-plugin'),
            'all_items'          => __('All Products', 'my-awesome-plugin'),
            'view_item'          => __('Show Products', 'my-awesome-plugin'),
            'search_items'       => __('Search Products', 'my-awesome-plugin'),
            'not_found'          => __('No products found', 'my-awesome-plugin'),
            'not_found_in_trash' => __('No products found in Trash', 'my-awesome-plugin'),
            'parent_item_colon'  => null,
            'menu_name'          => _x('Products', 'my-awesome-plugin')
        ];
$ params = [
            'public'             => true,
            'publicly_queryable' => true,
            'show_ui'            => true,
            'show_in_menu'       => true,
            'show_in_nav_menus'  => false,
            'query_var'          => true,
            'hierarchical'       => false,
            'menu_position'      => 6,
            'labels'             => $labels,
            'has_archive'        => $this->post_name,
            'capability_type'    => 'post',
            'menu_icon'          => 'dashicons-cart',
            'supports'           => [ 'title', 'page-attributes', 'thumbnail' ],
& # 39; rewrite & # 39; => [ 'slug' => "{$this->post_name}/%{$this->tax_name_cat}%/%{$this->tax_name_tag}%", 'with_front' => false ],
];
register_post_type ($ this-> post_name, $ params);
}

/ **
* Initialize taxonomy for cats
*
* Return invalid
* /
public function create_taxonomy_tag () {
$ labels = [
            'name'               => _x('Product Tags', 'my-awesome-plugin'),
            'singular_name'      => _x('Products Tags', 'my-awesome-plugin'),
            'search_items'       => __('Search Tags', 'my-awesome-plugin'),
            'all_items'          => __('All Tags', 'my-awesome-plugin'),
            'parent_item'        => __('Parent Tag', 'my-awesome-plugin'),
            'parent_item_colon'  => __('Parent Tag', 'my-awesome-plugin'),
            'edit_item'          => __('Edit Tag', 'my-awesome-plugin'),
            'update_item'        => __('Update Tag', 'my-awesome-plugin'),
            'add_new_item'       => __('Add New Tag', 'my-awesome-plugin'),
            'new_item_name'      => __('New Tag Name', 'my-awesome-plugin'),
            'menu_name'          => _x('Tags', 'my-awesome-plugin'),
            'rewrite'            => [ 'slug' => "{$this->post_name}/%{$this->tax_name_cat}%", 'with_front' => false ]
        ];
$ params = [
            'hierarchical'       => true,
            'show_ui'            => true,
            'show_in_nav_menus'  => true,
            'labels'             => $labels,
        ];
register_taxonomy ($ this-> tax_name_tag, $ this-> post_name, $ params);
}

/ **
* Initialize taxonomy for tags
*
* Return invalid
* /
public function create_taxonomy_cat () {
$ labels = [
            'name'               => _x('Product Categories', 'my-awesome-plugin'),
            'singular_name'      => _x('Products Categories', 'my-awesome-plugin'),
            'search_items'       => __('Search Categories', 'my-awesome-plugin'),
            'all_items'          => __('All Categories', 'my-awesome-plugin'),
            'parent_item'        => __('Parent Category', 'my-awesome-plugin'),
            'parent_item_colon'  => __('Parent Category', 'my-awesome-plugin'),
            'edit_item'          => __('Edit Category', 'my-awesome-plugin'),
            'update_item'        => __('Update Category', 'my-awesome-plugin'),
            'add_new_item'       => __('Add New Category', 'my-awesome-plugin'),
            'new_item_name'      => __('New Category Name', 'my-awesome-plugin'),
            'menu_name'          => _x('Categories', 'my-awesome-plugin'),
            'rewrite'            => [ 'slug' => "{$this->post_name}", 'with_front' => false ]
        ];
$ params = [
            'hierarchical'       => true,
            'show_ui'            => true,
            'show_in_nav_menus'  => true,
            'labels'             => $labels,
        ];
register_taxonomy ($ this-> tax_name_cat, $ this-> post_name, $ params);
}

/ **
* Create permalink structure
*
* @return string
* /
public function permalink_structure ($ post_link) {
global $ post;

if (false! == strpos ($ post_link, "% {$ this-> tax_name_tag}%")) {
$ term = get_the_terms ($ post-> ID, "{$ this-> tax_name_tag}");
if (! empty ($ term)) {
$ post_link = str_replace ("% {$ this-> tax_name_tag}%", array_pop ($ term) -> slug, $ post_link);
} else {
$ post_link = str_replace ("% {$ this-> tax_name_tag}%", & nocat & # 39 ;, $ post_link);
}
}

if (false! == strpos ($ post_link, "% {$ this-> tax_name_cat}%")) {
$ term = get_the_terms ($ post-> ID, "{$ this-> tax_name_cat}");
if (! empty ($ term)) {
$ post_link = str_replace ("% {$ this-> tax_name_cat}%"), array_pop ($ term) -> slug, $ post_link);
} else {
$ post_link = str_replace ("% {$ this-> tax_name_cat}%", "notag", $ post_link);
}
}

return $ post_link;
}
}

New Products();

Information Architecture – What would be the best way to organize a form development tool with questions that can optionally be grouped by categories and subcategories?

I'm developing a form design tool that some customers can use to fill in some surveys.

The form can be filled with questions associated with different form elements (text, selections, checkboxes, etc.). These can optionally be grouped by categories and subcategories if required.

Consider this possibility:

Question 1 - Enter your name
| - Question 2 - Enter your ID number
| --- Category [Car]
Question 3 - Which year is your car?
| ----- Category [INTERIOR]
Question 4 - What color is the interior?
Question 5 - Do you have steering wheel controls?
| ----- Category [EXTERIOR]
Question 6 - What color is the exterior color?
Question 7 - How big are the tires?

As you can see, questions 1 and 2 are outside the categories. Question 3 is in Category CARand questions 4,5 and 6,7 are each in subcategories INNER and OUTSIDE respectively.

I'm currently using jQuery UI with the draggable and sortable Interactions. So far, it works reasonably well until I came to the part where I need to use categories for these things.

I have a page gutter menu that contains the available form elements, and the main window has an empty area where you can place the elements. The items that are pulled out of the gutter are cloned so they can be reused.

My problem is that I can not find a reasonable way to organize these questions in a logical way that will not upset the admins who will create those forms.

I took the step to create a draggable piece that is called category This serves as a separator in the form, but something is missing in the entire user-centered design space. I also need to figure out how to best add subcategories once a category has been added.

All thoughts or comments are welcome! I am really excited about this. I am usually 70% developer and 30% UI / UX. But I feel like I should run and hide.

Web Development – Possible developers for a mobile application

I'm a 15 year old kid with a mobile app idea that could be funded. I know little or nothing about programming or development, and if I had learned I would need several years to complete this project idea.

I'm starting to wonder about potential developers who help me with this project, and I need help with this initial phase of ideas. Which software developers should I support with this idea? Or is a developer the best choice? I am not sure what the best course of action is and would be pleased to receive advice. Many Thanks.

AJAX is much slower in the production environment than in the development environment

I'm using Commerce AJAX in the shopping cart in Drupal 7, and the average time for an AJAX call on the development site is 100 to 200 ms. On the live site, these calls take 1-3 seconds. The development code base and the database are up-to-date with the production site.

Is this most likely a problem with the hosting environment?