• Home
  • Portfolio
  • WordPress
    • Plugins
      • Google Analytics Head
      • Post/Page specific custom CSS
      • Queen Inspirations
    • Themes
    • Others
      • Localize JavaScript code
      • Custom bulk actions
      • Hide your login
      • Admin buttons
  • GitHub
Łukasz Nowicki

Lead PHP/WordPress Engineer

  • WordPress
  • Woocommerce
  • PHP
  • Plugin
  • Development
  • Github
  • Windows
  • Gulp
  • WordPress
  • Woocommerce
  • PHP
  • Plugin
  • Development
  • Github
  • Windows
  • Gulp

Popular posts

  • Insert new woocommerce product programmatically
  • Add woocommerce category programmatically
  • Get_terms and invalid taxonomy
  • Assign woocommerce product categories programmatically
  • WordPress 4.7
  • WordPress

    WordPress 4.7 – first beta available

    October 28, 2016 /

    Today, WordPress development team has announced first beta release of WordPress 4.7. Final release is slated on Dec 6th, good time to release new WordPress thoug. Biggest thing for common users is new default theme. Guess the name… yes, you are right – Twenty Seventeen 🙂 What else? Multi-language support for administrators, video headers, PDF thumbnails, expanded Settings Registration API, post type templates and many many more. You have to see it!

    read more
    Łukasz Nowicki 0 Comments

    You May Also Like

    WordPress 4.6 Release Candidate

    August 2, 2016

    WordPress 4.2 Beta 2

    March 26, 2015

    Your password reset link appears to be invalid. Please request a new link below.

    October 12, 2017
  • Author

    Google Analytics

    October 8, 2016 /

    Some of you know, that I wrote Google Analytics Head plugin for WordPress (freely available in WordPress repository). Of course I use it on my webpages, and today I look at its results. Well, I was impressed! Almost 22% from India! Second place – Canada (over 10%) and third – USA (about 5%). Well, I heard a lot about programmers in India, thank you for using my blog! Most popular article is, no surprises here, Insert new woocommerce product programmatically. I like it, too. I hope we will meet in the future!

    read more
    Łukasz Nowicki 0 Comments

    You May Also Like

    Panom i Paniom z HR pod uwagę

    July 6, 2017

    What PHP version do you use?

    July 27, 2015

    What PHP version do you use? Part 2.

    January 30, 2016
  • Development,  Woocommerce,  WordPress

    Add woocommerce category programmatically

    October 5, 2016 /

    As I promised in this article Assign woocommerce product categories programmatically, I will explain how to create woocommerce category programmatically. It is very easy, just use this code: [crayon-651dd40b7112e718108192/] You should get something like this: [crayon-651dd40b71134009594023/] However, sometimes you may get WP_Error. Sometimes, category may already exists. You must check the result, if it isn’t WP_Error object. So, if you need to add category or get existing category ID, use this: [crayon-651dd40b71136950917984/] This code uses PHP7 construction (?? – null coalesce operator), you may substitute it with isset when using earlier PHP version (or much better – upgrade your PHP or your hosting operator!) Remember to wrote this code in…

    read more
    Łukasz Nowicki 2 Comments

    You May Also Like

    Add theme support – basics

    September 30, 2016

    Let’s build WordPress theme – part 2

    October 16, 2014

    Assign woocommerce product categories programmatically

    October 5, 2016
  • Development,  Woocommerce,  WordPress

    Assign woocommerce product categories programmatically

    October 5, 2016 /

    How to assign categories for your Woocommerce products programmatically? Well, it isn’t that hard. First of all, you must know the ID of your product. If you insert your product programmatically, it is easy, you got it. If not, you can see ID for many ways, for example in your edit screen (something like http://example.com/wp-admin/post.php?post=123&action=edit – 123 is your product ID). Let’s assume you’ve got your product ID in the $product_id variable. Now, you must decide if you want to assign product to existing category or create category by yourself? Well, if you already got category, you need your term ID. How to get it? Go to product categories list…

    read more
    Łukasz Nowicki 2 Comments

    You May Also Like

    Post class and Body class with WordPress

    September 12, 2016

    WP_Import has a deprecated constructor in…

    January 3, 2016

    Date and Time – PHP way – part 3

    July 3, 2017
  • Development

    Deleting non empty directory

    October 3, 2016 /

    I assume that you are aware of the rmdir function. This is very useful function, however it has its own limitations. The biggest one is that you are not able to delete non empty folders. We need to build our own function. First, we will use recursion and second – this actually won’t be a function. We will write a method instead. Of course you may translate it into function, it is very easy (just remove $this->). [crayon-651dd40b71de7422664018/] Please remember – this is a method, part of the class.

    read more
    Łukasz Nowicki 0 Comments

    You May Also Like

    WordPress: How to localize your JavaScript code?

    July 10, 2017

    How to hide toolbar (admin bar)?

    September 11, 2016

    Let’s build WordPress theme – part 3

    October 31, 2014
  • Development

    Different value and label of the input submit

    October 2, 2016 /

    Once upon a time (today), I stuck into this problem: I needed GET form with a few submit inputs. However, I needed numeric GET values (1-5) but I wanted to keep it simple for users – and I needed different labels than values… After some thinking, I figured it out. I can’t use input submit, I must use button! And here we are: [crayon-651dd40b71fa7729107879/] A piece of cake.

    read more
    Łukasz Nowicki 0 Comments

    You May Also Like

    How to get rid of Open Sans and save admin bar?

    August 1, 2016

    Get woocommerce random products

    January 10, 2017

    Add woocommerce category programmatically

    October 5, 2016
  • Development

    Showing all errors, warnings, notices…

    October 1, 2016 /

    Why would you like to show all errors, warnings, notices, etc? Well, this is the first and easiest way to debug your PHP script. Of course there is a bunch of scripts and debug tools out there, but we do not need sledgehammer to crack a nut, don’t we? So, first thing is to turn this on on your local or staging server. Second thing, but even more important!, is to turn it off on your production server! You don’t want your users to see what is wrong this way. OK, let’s go to code: [crayon-651dd40b72132661383105/] And that’s all! Of course you may need it more complicated way. Something like:…

    read more
    Łukasz Nowicki 0 Comments

    You May Also Like

    WordPress admin buttons once again

    December 16, 2016

    Using jQuery UI CSS in admin screen

    January 30, 2017

    Insert new woocommerce product programmatically

    March 6, 2016

Search site:

Categories:

  • Author
  • Development
  • Github
  • Gulp
  • PHP
  • PL
  • Plugin
  • Windows
  • Woocommerce
  • WordPress

Recent posts:

  • HTML Knowledge Base
  • Using native WordPress loading icons (spinners) in your plugins
  • Did you forget to signal async completion?
  • Country codes as PHP array
  • RODO i WordPress – wydanie 4.9.6
  • Enable multisite network
  • Showing all errors and warnings

Polish Internet Trends

  • PHP Speed Test (5.2 – 8.0)

Recent comments:

  • Łukasz Nowicki on Post/Page specific custom CSS
  • Daud on Post/Page specific custom CSS
  • Wojtek on Country codes as PHP array
  • Łukasz Nowicki on Assign woocommerce product categories programmatically
  • Kil on Assign woocommerce product categories programmatically
  • Martin Piñeiro on Insert new woocommerce product programmatically
  • Łukasz Nowicki on Your password reset link appears to be invalid. Please request a new link below.

Archives

  • May 2020
  • September 2018
  • July 2018
  • May 2018
  • February 2018
  • January 2018
  • December 2017
  • October 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • May 2015
  • April 2015
  • March 2015
  • October 2014
  • September 2014
Ashe Theme by WP Royal.