1,033 reputation
49
bio website dessibelle.se
location Malmö, Sweden
age 30
visits member for 3 years
seen Dec 18 at 10:48

Developer. Really into web, iOS and bluegrass music.

github profile


Dec
13
revised Change ul class=“children” for wp_list_pages?
Added parentheses
Dec
6
awarded  Yearling
Sep
2
revised Polylang: pll_e() & pll__() on functions.php, doesn't work
Typos and clarifications
Mar
10
revised What is the structure of the “Featured Image” field in the DB?
added 5 characters in body
Mar
7
answered Best pratice to make taxonomy terms translatable without changing slugs?
Mar
7
answered What is the structure of the “Featured Image” field in the DB?
Jan
21
awarded  Constituent
Jan
14
awarded  Caucus
Dec
6
awarded  Yearling
Nov
11
comment Change ul class=“children” for wp_list_pages?
I'm not sure I understand. The add_parent_class callback function will remove any css classes for pages having child pages, but I'm not sure how that would apply to lis in this case. If you want to add other classes or remove them in other cases, just modify the code to suit your needs.
Nov
11
comment Change ul class=“children” for wp_list_pages?
@RanaMuhammadUsman: Perhaps WordPress (or another filter) is not supplying all of the function parameters for the page_css_class filter (anymore). Just add some default values for your callback function and you should be fine. See updated answer for details.
Nov
11
revised Change ul class=“children” for wp_list_pages?
Added default values for method parameters
Oct
1
revised Wordpress triggers 404 on page 2 for custom search query
Updated the method for setting $wp_query->is_404
Oct
1
comment Wordpress triggers 404 on page 2 for custom search query
@BasTaller, you are absolutely right obviously. I've updated my answer accordingly. Thanks for pointing that out.
Jun
24
comment How to set featured image to custom post from outside programmatically
@hitautodestruct: Absolutely, I often do that when migrating data form existing sites, legacy systems, database exports etc. My point is you should always strive to take advantage of the WordPress core functionality to accomplish this, rather than just writing a script of your own that places the images at the correct location (which was to some extend what I perceived the question was about).
May
29
answered How can i alter the amount of different images sizes being stored?
May
27
comment How to set featured image to custom post from outside programmatically
Check to documentation for wp_insert_attachment(), it should do much what you need I think. I would highly discourage manually modifying the database outside of WordPress if that's what you are doing. Instead, just look at the WordPress source and try to identify the parts responsible for adding post data, handling file uploads and inserting attachments. In other words, pretty much what I outlined in my answer above.
May
27
answered How to set featured image to custom post from outside programmatically
May
18
revised How to output number of comments with link to comments
added 6 characters in body
Apr
24
answered Run shortcode before filters