Empty trash hook in wordpress

In some cases we may want to delete data related to certain post stored in some custom table (i.e. data which is currently not in wordpress). If the data related to a post is not in wordpress then it won't get cleaned once the post is deleted from the wordpress and you may end up garbage and unmanageable data in your custom table. e.g. we have a custom post to register attendees to our events. There is also a need to log if the user had attended previous events too and to maintain their preferences for each year/event. Since it is not possible to store such yearwise/eventwise data in wordpress through custom fields, we may end up creating our own custom table. The requirement is when the user gets deleted from the system, the data stored about the user in the custom table should also get deleted Wordpress provides a hook to clean such data stored in your custom table. [crayon-59c7ea2ec4c87432914764/]    ...
Read More
How to install Cocoapods

How to install Cocoapods

Start by typing below command in terminal [crayon-59c7ea2eca790986635265/] In most cases just the second command would however sometimes you may get below error in case you have an older version of activesupport installed Error installing cocoapods: activesupport requires Ruby version >= 2.2.2 The first command will make sure you don't get the above error Once the above commands run successfully type below command to set up Cocoapods master repo [crayon-59c7ea2eca79e975152602/] This will download the master repo. The size of the repo is quite big around 380MB so it can take a while depending upon your internet download speed. Once the above is completed, navigate within terminal to your Xcode project and run below command to create the podfile [crayon-59c7ea2eca7a2971542043/] Open the newly created podfile with text editor, and add the required libraries e.g. pod 'Google/Analytics' Then run below command to install the required libraries [crayon-59c7ea2eca7a7999439037/]  ...
Read More