Sell access to form [closed]

Probably going to be a custom meta type on the users. During the sign up process to your website use the add_user_meta() function and declare the value as 0. Then as people buy from your shop you’re going to have to find a hook somewhere in WooCommerce (Maybe on the order complete page?) to update … Read more

Get Image Having the ID [closed]

Put the below code in your functions.php and then you can use this [get_image_by_id id=”your-image-id”] shortcode to get the image add_shortcode( ‘get_image_by_id’, ‘the_dramatist_get_image_by_id’); function the_dramatist_get_image_by_id($atts) { return wp_get_attachment_image($atts[‘id’]); } Here “your-image-id” is numeric ID of the image. Hope that helps.

I want to generate the pdf and save it in library?

Saving in WordPress library can be done by using this function media_handle_upload. PDF can be created in many ways. The best method depends on your runtime enviroment and the functionality you are looking for. There are several PDF generating libs for PHP out there, for example PDFlib. But again your question is far broad.

Where do plugin variables live in the db?

Where to store plugin settings in the database is technically up to the plugin developer. I’ve seen some plugins that create custom database tables. The standardized method, however, is to use the WordPress site options table (i.e. wp_options). That’s what will be used if the developer uses the WordPress settings API. You can view a … Read more

plugin generated unexpected output during activation, but it is empty

You may have empty characters at the beginning before the <?php block. You may also try to var_dump($result->get_error_data()) this error message — this would be the dirty way. File: wp-admin/plugins.php 42: $result = activate_plugin($plugin, self_admin_url(‘plugins.php?error=true&plugin=’ . $plugin), is_network_admin() ); 43: if ( is_wp_error( $result ) ) { 44: if ( ‘unexpected_output’ == $result->get_error_code() ) { … Read more