• 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! [postad1]

    read more
    Łukasz Nowicki 0 Comments

    You May Also Like

    Third beta

    November 12, 2016

    Image Widget – WordPress 4.8

    May 27, 2017

    WordPress 4.5 Coleman

    April 12, 2016
  • 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! [postad1]

    read more
    Łukasz Nowicki 0 Comments

    You May Also Like

    Photography source

    January 25, 2017

    Happy PHP

    May 27, 2016

    What PHP version do you use?

    July 27, 2015
  • 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:

    read more
    Łukasz Nowicki 2 Comments

    You May Also Like

    Get_terms and invalid taxonomy

    April 26, 2016

    Using native WordPress loading icons (spinners) in your plugins

    May 2, 2020

    Post class and Body class with WordPress

    September 12, 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

    WordPress: How to localize your JavaScript code?

    July 10, 2017

    Always remember about variable type

    February 12, 2017

    Do you like WordPress admin buttons?

    December 12, 2016
  • 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->). public function del_directory( $dir ) { if ( is_dir( $dir ) ) { $objects = scandir( $dir ); foreach( $objects as $object ) { if ( ( $object != '.' ) && (…

    read more
    Łukasz Nowicki 0 Comments

    You May Also Like

    How to hide toolbar (admin bar)?

    September 11, 2016

    Using dollar sign $ and jQuery in WordPress

    March 20, 2016

    How to style widget description in admin menu?

    July 23, 2017
  • 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: [postad1] Label 1 A piece of cake.

    read more
    Łukasz Nowicki 0 Comments

    You May Also Like

    Add woocommerce category programmatically

    October 5, 2016

    Did you forget to signal async completion?

    September 4, 2018

    How to add your custom css or js on admin screen?

    January 12, 2017
  • 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:

    read more
    Łukasz Nowicki 0 Comments

    You May Also Like

    WP_Import has a deprecated constructor in…

    January 3, 2016

    Showing all errors and warnings

    January 8, 2018

    Insert new woocommerce product programmatically

    March 6, 2016

Search site:

Categories:

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

Recent posts:

  • WooCommerce – HPOS
  • 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

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 2025
  • 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.