Search post by post meta with rest api.

Use filter rest_{$this->post_type}_query to add the post meta support in WP Rest API.

Use below code snippet to add the post meta support for post type Post.


How to use?

E.g. Get posts which post meta already-visited value is true.

Code Snippet:


Getting curl to output HTTP status code?

A more specific way to print out just the HTTP status code is something along the lines of:

curl -s -o /dev/null -w "%{http_code}"



mysqld.exe: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files

While I have started the XAMPP after a long break up to 1/2 months and I got the error ‘mysqld.exe: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files’.

To fix this error I have deleted the file aria_log.00000001 from location D:\xampp\mysql\data\

MySql errors:

2018-05-07 19:36:12 1f84 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2018-05-07 19:36:12 8068 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2018-05-07 19:36:12 8068 [Note] InnoDB: The InnoDB memory heap is disabled
2018-05-07 19:36:12 8068 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2018-05-07 19:36:12 8068 [Note] InnoDB: Memory barrier is not used
2018-05-07 19:36:12 8068 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-05-07 19:36:12 8068 [Note] InnoDB: Using generic crc32 instructions
2018-05-07 19:36:12 8068 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2018-05-07 19:36:12 8068 [Note] InnoDB: Completed initialization of buffer pool
2018-05-07 19:36:12 8068 [Note] InnoDB: Highest supported file format is Barracuda.
2018-05-07 19:36:15 8068 [Note] InnoDB: 128 rollback segment(s) are active.
2018-05-07 19:36:15 8068 [Note] InnoDB: Waiting for purge to start
2018-05-07 19:36:15 8068 [Note] InnoDB:  Percona XtraDB ( 5.6.28-76.1 started; log sequence number 736124072
2018-05-07 19:36:15 4532 [Note] InnoDB: Dumping buffer pool(s) not yet started
Cannot find checkpoint record at LSN (1,0x2e77)

2018-05-07 19:36:15 8068 [ERROR] mysqld.exe: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files
2018-05-07 19:36:15 8068 [ERROR] Plugin 'Aria' init function returned error.
2018-05-07 19:36:15 8068 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2018-05-07 19:36:15 8068 [Note] Plugin 'FEEDBACK' is disabled.
2018-05-07 19:36:15 8068 [ERROR] Aria engine is not enabled or did not start. The Aria engine must be enabled to continue as mysqld was configured with --with-aria-tmp-tables
2018-05-07 19:36:15 8068 [ERROR] Aborting


Developers and their plugins must not do anything illegal, dishonest, or morally offensive

While this is subjective and rather broad, the intent is to prevent plugins, developers, and companies from abusing the freedoms and rights of end users as well as other plugin developers.

This includes (but is not restricted to) the following examples:

  • Artificially manipulating search results via keyword stuffing, black hat SEO, or otherwise
  • Offering to drive more traffic to sites that use the plugin
  • Compensating, misleading, pressuring, extorting, or blackmailing others for reviews or support
  • Implying users must pay to unlock included features
  • Creating accounts to generate fake reviews or support tickets (i.e. sockpuppeting)
  • Taking other developers’ plugins and presenting them as original work
  • implying that a plugin can create, provide, automate, or guarantee legal compliance
  • Utilizing the user’s server or resources without permission, such as part of a botnet or crypto-mining
  • Violations of the WordCamp code of conduct
  • Violations of the Forum Guidelines
  • Harassment, threats, or abuse directed at any other member of the WordPress community
  • Falsifying personal information to intentionally disguise identities and avoid sanctions for previous infractions
  • Intentionally attempting to exploit loopholes in the guidelines

Read more in the Detailed Plugin Guidelines.

Create a simple shortcode in WordPress

Use code snippet to create a simple WordPress shortcode. I have created a sample shortcode prefix-portfolio with 2 attributes.

Before use change:

  • Change the Prefix with your own unique prefix.
  • Change the prefix with your own unique prefix.

How to use?

  1. Create a new page and add shortcode.
  2. Open the page. It’ll show the output of the shortcode like below:

Code Snippet

Debug WordPress hook sequence

Debug WordPress hook sequence

How it works?

Add query parameter debug in URL e.g. https://<mysite>/?debug. It’ll show the list of hooks in sequence.

Code Snippet

Register or Enqueue Google fonts in WordPress Theme

A valid way to register the Google fonts in the theme or plugin.