Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [extend]

The tag has no usage guidance.

0
votes
1answer
55 views

Overriding an Array in a Plugin's Class/Function from functions.php

There is a plugin I have installed that loads a metabox of an array ($requirements) list of items in edit post. When I print_r the plugin's array it shows: Array ( [item1] => Array ( ...
0
votes
0answers
51 views

How to extend gutenberg page attributes?

How can I add an extra option under page attributes in Gutenberg editor? I would like to have a radio to show, hide page title
3
votes
1answer
406 views

Gutenberg extend core blocks

How do I modify a core block, in my case gallery block to add extra markup to can fire some lightbox on created gallery. Is there a way to hook in on render of gallery on frontpage to adjust markup?
0
votes
0answers
31 views

Hiding class namespace from plugin's extensions

I'm developing a plugin using this boilerplate and I designed it to be extensible. The boilerplate supports namespacing and uses it and namespaces are bind to folder structure. The extensible part is ...
2
votes
0answers
185 views

Gutenberg: How to mix dynamic and static output?

Gutenbergs handbook (https://wordpress.org/gutenberg/handbook/blocks/creating-dynamic-blocks/) suggests to return null in the save() function for dynamic blocks. But what if I only want parts of my ...
0
votes
1answer
470 views

Add search Value to wp_list_table pagination

I have a custom WordPress table using wp_list_table, with a search field: the search works well, but I am seeing that the search value isn't added to the pagination links when there are multiple pages ...
0
votes
0answers
766 views

How can I override the WooCommerce cart with my own class extending WC_Cart?

On our multisite network, I have a plugin with if( is_main_site(get_current_blog_id()) ) WC()->cart = new WC_Custom_Cart; class WC_Custom_Cart extends WC_Cart { public function __construct() { ...
1
vote
0answers
55 views

Better extend a class or use add filter/action hooks?

I got a "theorical" question here. I made a Wordpress plugin that scrapes content from remote website. It as a Scraper_Class with generic "methods" to scrape remote content. eg. Scraper_Class { ...
0
votes
0answers
1k views

Extend plugin Class through functions.php

Move manual fix applied to plugin source code to theme functions.php or as Code Snippet I've applied a manual fix to a plugin file. I'd like to make this fix more accessible and scalable by hooking ...
0
votes
1answer
45 views

creating new field on mysql

I would like to add extra sections like "gender" on the WordPress user database. I would like to draw information from this information later. For example, let's say I want to attract gender. I ...
0
votes
1answer
487 views

PHP Helper Class to create shortcodes

I created a helper class to extend other classes for shortcodes. When I try to use $this in the add_shortcode() function I'm getting this error: Using $this when not in object context How can I ...
1
vote
1answer
624 views

wp_dropdown_categories and custom attribute

I'm using this jQuery plugin to handle select element on my site: bootstrap-select Unfortunately, I can't found any option which allow me add a custom attribute to the select element, for e.g: I ...
0
votes
1answer
51 views

Am I using an action hook correctly?

I want to extend an existing plugin by writing my own. I think I instantiated it correctly because it appears on the plugin list in the dashboard (although I found it strange that I didn't need to ...
0
votes
1answer
25 views

Which One Is Better For Managing Add Ons For Extensible Plugin?

How do you manage addons for extensible plugin? I am writing an extensible plugin, but I feel confused whether to create a custom manager for the add ons install/ uninstall and list them or just ...
2
votes
2answers
720 views

Extending Shortcode attributes

I've searched many places and tried many ways for this but no success. I have a shortcode in my WP Theme like; [recent_posts layout="thumbnails-on-side" columns="4" number_posts="4" offset="" ...
1
vote
1answer
1k views

Extending the WP_Widget_Text class

I am trying to alter the output of the default WordPress text widget. Since the widget is written in OOP I hoped it could be a simple deal of extending the class and overwriting one method – but it ...
0
votes
1answer
4k views

How to get private property in parent class into extended class?

I am not sure if my function is firing before another funciton or if I am having issues with the $this variable when I am extending my class. I am creating a function in my functions.php file. Here's ...
0
votes
0answers
23 views

Where do I add my own configuration needs and how do I access them?

Somehow despite having been developing web sites since the late 90's I'm only now working on my first WordPress site. And I'm having a bit of trouble understanding the organization of WordPress and ...
0
votes
1answer
836 views

Extend walker - navigation, adding data attribute to a tag

I would a data attribute to the a tag in the menu, like have <a href="#example" data-attribute="attribute">CLICK</a> I know that I have to extend the Walker BUT I tried in several times ...
0
votes
1answer
1k views

Extend WP_Customize_Control with Multiple Field Control

I'm trying to figure out how to code a custom control but frustratingly all the information I find online points to the same example of creating a single textfield. I'd like to create a custom ...
0
votes
1answer
282 views

New checkbox in custom widget isn't saving data

I'm trying to develop my own widget. Mostly cause I want to understand Wordpress functionality (yes I'm completely new. First ever try to extend wordpress) I want to add a function to display post ...
3
votes
1answer
4k views

How do I extend one plugin I'm writing with another I'm writing using classes?

I have a set of plugins that do different things. I'm wanting to write a plugin with a class I can extend in each of my custom plugins to meet a common goal. In my "socket" plugin I have something ...
1
vote
1answer
385 views

Extending WP_Widget throws error when Monster Widget used

I wanted to override the output for the core Recent Comments Widget. I extended WP_Widget_Recent_Comments made the changes needed and it displays exactly how I want. However, I have now tested the ...
0
votes
1answer
46 views

Can WordPress handle following functionalities?

Now i am planning a development of a new web site and searching for a CMS. I know WP not bad, but never tried to build a complex community information site using this engine. Among basic requirements ...
2
votes
1answer
5k views

Extending WC_Cart in woocommerce

I am trying to extend WC_Cart in woocommerce, from what i understand my code should be correct. However when I load the cart I get the following message. Fatal error: Call to undefined method ...
2
votes
1answer
567 views

Extending wordpress search to include excerpts and taxonomies?

Apologies for the lack of code, but I have no idea where to start with this - is it possible to extend Wordpress's search function to include excerpts and (custom) taxonomies as well as the standard ...
4
votes
2answers
263 views

How to create extendable wordpress plugins

I have a generic question that I would like to ask. How do we go about creating an extendable wordpress plugin. I would like to create a plugin that I can easily allow new extensions to be hooked up ...
1
vote
1answer
3k views

how to extend a WP_widget twice

Has someone ever tried to extend calss WP_Widget, then extend it again ? Having to related widgets, I tried to create the first extending WP_Widget, : class FirstWidget extends WP_Widget { public ...
1
vote
1answer
81 views

wordpress.org codebase

Is the codebase that runs wordpress.org publicly available? Specifically, I'm interested in the part that parses the plugins SVN repository to determine the current and past versions of plugins. I ...
-1
votes
1answer
410 views

Extending Widgets - Exclude # of posts field from Recent Posts Widget

I am currently using this code to extend WP_Widget_Recent_Posts, but I would like to exclude the field that gives the user the ability to show how many posts they want. I have a set number in my ...
1
vote
1answer
659 views

Setting up widgets in wordpress with a unique ID for the after_title argument

I try to get the collapsible-widget-area plugin so that every widget it creates inside the collapsible area has a unique id <div> after its title. function get_args() { $this->args = ...
0
votes
1answer
3k views

Extending core class in plugin

Hi I am writing a plugin and would like to extend a class in the wp-includes folder. I mean that literally like class my_class extends wp_includes_class_x{ ... } However when attempting this I get a ...
5
votes
3answers
508 views

Plugin (or Theme) containing its own Plugins?

My Theme defines its own actions and filters so that it can be extended by third-parties without having to fork or modify the Theme's core code. I already have a few plugins specific to my Theme, ...
0
votes
1answer
1k views

Change how WP e-Commerce calculates price total at checkout [closed]

My situation: I'm selling a few products. I need to get some options at checkout (like Do you want to add installation services?) that will affect the price, and I need to reference a custom ...
0
votes
1answer
224 views

Custom Module, Extending WP with a Plugin?

I'm trying to determine the best way to expand on WP. I love the base of WP for a website... it has pretty much everything needed for a website. But now and again I need to be able to create some ...
0
votes
1answer
482 views

Extending Twenty Eleven Theme

In WP 3.3, how can I extend the Twenty Eleven theme such that I can make some custom additions or modifications but still take benefit in the updates that WP pushes out for the theme? Sort of like '...
1
vote
1answer
4k views

How to extend a class in WordPress?

I am ussing bbPress and want to extend the BBP_Shortcodes class in order to replace a function with my own. Here is my basic snippet which seems to do nothing: class WPTUMBLE_Shortcodes extends ...
2
votes
2answers
87 views

When developing a distributable Theme, does it HAVE to be “inheritable”?

I'm currently developing a complex Theme (or framework, if it can be called that) for my own personal use. However, in the event that it becomes appreciated to the public - does it necessarily HAVE ...
0
votes
2answers
1k views

Add some fileds to the wp_posts table

I need to extend some wp tables (wp_posts, wp_comments, wp_users) to store some additional fields. I can't use metadata because I need to query those values directly via MySQL. I need an help to ...
4
votes
3answers
3k views

How can i increase the login expiration length?

As the title says, how can i increase the login expiration period? Running a local install it's a little annoying to have to keep logging in, despite the fact i have the browser remember login ...