AppCamera Setup

The AppCamera extension allows your app users to take photos that will be uploaded directly to your WordPress site. You can then display those photos in your app.

AppCamera also has integrations with WooCommerce, BuddyPress, and a shortcode you can use on any post or page.

Installing the AppCamera extension.

  1. Install and activate the AppCamera plugin that you purchased from your AppPresser account.
  2. You will now find a new "AppPresser Camera" tab in your AppPresser settings. Please visit there to configure the Camera extension settings.

Configuring AppCamera.

The AppCamera extension offers multiple settings to help you configure its behavior. Below we will discuss each in greater detail.

  1. Camera License Key
    • Add the license key you received, with your purchase, here. This will enable you to receive updates for the plugin as we release them.
  2. Uploaded photos must be moderated?
    • Use this setting if you want to be able to review/approve/deny all uploaded photos before they get published live.
  3. Email new photos to admin email
    • Use this setting if you want to be notified by email, using the WordPress-set admin email address, whenever a user uploads a new photo, regardless of moderation being required.
  4. Save Photos to Featured Image
    • When you enable this, and have uploads set to create new posts, the uploaded image will also be set as the post's featured image.
  5. Photo upload description
    • Text that will be displayed as a description on the rendered upload form.
  6. Text to display if logged out
    • Text that will be displayed to logged out users.

Once you are happy with the settings, click the "Save Settings" button.

Using AppCamera

AppCamera automatically adds a photo upload button to WooCommerce product photo galleries and the BuddyPress activity modal (with the AppBuddy and AppWoo plugins also installed).

You can also manually add the shortcode (described below) to a page or post, which shows a photo upload button in your app. The Take Photo and Upload Image buttons only appear when a user is logged in, otherwise they will see "Please login" text. It is not secure to let logged out users upload images to your site, so this is not an option in our plugin.

Displaying AppCamera Images

The AppCamera plugin does not handle displaying your images for you, but there are a variety of ways to do this.

Gallery shortcode

You can add a WordPress [gallery] shortcode on the same page that you have the [app-camera] shortcode. This will display your images as you see in the image above. Note that this page does not refresh dynamically to display newly uploaded images, but you can use Javascript to do that if needed.

Action="new"

If you are using [app-camera action="new"], each photo will create a new post. You can then display these posts any way you like, such as a custom template in your theme, a plugin like  Display Posts Shortcode, etc.

You can use the post_type attribute to specify a post type that you have already registered, such as "app_photos" to only display these photos and not other posts. This method supports moderation.

[app-camera]

Attribute type Details Available parameters
action string Specifies where to post the photo to. "This" is the post or page the form is on, "new" is a new post or page, and "library" posts to the media library unattached to a specific post or page. this, new, library 
Default: this
post_type string Allows you to specify a post type to post the photo to. Note: this parameter can only be use when action is "new" any post types that are registered. 
Default: post 
Note: use the post type slug.
post_title boolean Sets whether to display a "title" field for the form. If set to true, the form will display a "Title" field that you can use to name the created post. false, true 
Default: false
not_logged_in string What text to display for not logged in users. Default: "Not logged in" saved setting or "Upload your own customer image"
description string What text to display for the description. Default: "Description" saved setting or "Upload your photos!"

force_login boolean Set to "false" to allow logged out visitors to upload photos. Default: "true"

Examples:

[app-camera action="new"] 
[app-camera post_type="page"] 
[app-camera post_title="true"] 
[app-camera not_logged_in="Please log in first"] 
[app-camera description="You can upload your photos!"]

Note: you only need to use one shortcode at a time, and you can combine multiple parameters. For example:

[app-camera post_type="page" force_login="false" action="new"]<br>

Moderating Uploads.

You can choose to moderate images before they are displayed on your site.

[app-camera action="new"]

To moderate photos, go to the AppPresser settings page, Camera tab, and check "Uploaded photos must be moderated?" and save. 

If you have checked that uploads need to be moderated before being added, the section for this will not appear until there are actually any to moderate. Once moderation-pending photos are available, you will see a new "Moderate Photos" submenu item in the "AppPresser" menu. Next to it will be a notification of how many are pending to be approved. You will also be able to access this page from a "Photo Moderation Panel" link that will show up next to the "Save Settings" button in the AppCamera tab.

When viewing the moderation page, you will be presented with a list of pending photos that you can view, approve and deny. A thumbnail preview, file name/type, uploader, post it was uploaded to, and date will all also be available information. Checkboxes along the left allow you to approve or deny in bulk, and each has their own approve or deny links.

Once the queue is empty, the menu item and link will disappear until there are more to take care of.

AppCamera Hooks

appp_after_camera_buttons

Type: Action | File: appp-camera.php | Since: 1.0.0

Hooks right after the form for the photo upload has displayed

appp_after_process_uploads

Type: Action | File: inc/upload.php | Since: 1.0.0

Hooks right after the photo upload handling is done. Passes in the affected post ID and the new attachment ID from the upload. This allows you to do more processing on either post or attachment afterwards.

appp_before_camera_buttons

Type: Action | File: appp-camera.php | Since: 1.0.0

Hooks right before the form for the photo upload is displayed

active_plugins

Type: Filter | File: appp-camera.php | Since: 1.0.0

Allows you to intercept get_option( 'active_plugins' ) before our extension determines if the required plugins are presently active.

Default value:

get_option( 'active_plugins' ) //Saved value from your WP install. Not specific to AppPresser
	

appp_camera_description

Type: Filter | File: appp-camera.php | Since: 1.0.0

Allows you to intercept and modify, if needed, the text to display as the description. This value is originally set in the Camera section of the AppPresser Settings page.

Default value:

'Upload your photos!'
	

appp_camera_not_logged_in_text

Type: Filter | File: appp-camera.php | Since: 1.0.0

Allows you to intercept and modify, if needed, the text to display to not logged in users. This value is originally set in the Camera section of the AppPresser Settings page.

Default value:

'Upload your own customer image!'
	

appp_camera_post_title_label

Type: Filter | File: appp-camera.php | Since: 1.0.0

Allows you to intercept and modify the label for the post_title field that is displayed via the  [app-camera] shortcode.

Default value:

'<label>' . __( 'Title:', 'appp' ) . '</label>'
	

appp_upload_email_message

Type: Filter | File: inc/upload.php | Since: 1.0.0

Allows you to intercept and modify the default message that gets set with the email notifications for new uploads.

Default value:

An image tag with the newly uploaded image. Approve/Deny links if moderation is enabled.

appp_upload_email_subject

Type: Filter | File: inc/upload.php | Since: 1.0.0

Allows you to intercept and modify the default subject that gets set with the email notifications for new uploads.

Default value:

'A new photo was uploaded.'
	

appp_upload_email_to

Type: Filter | File: inc/upload.php | Since: 1.0.0

Allows you to intercept and modify the default email recipient who will get the email notifications for new uploads.

Default value:

get_settings( 'admin_email' )
	

appp_camera_photo_blog_embedded_img_size

Type: Filter | File: appp-camera.php | Since: 1.0.1

Allows you to intercept and modify the default size for photo blog image embeds.

Default value:

array( 768, 2500, false ) // First parameter is width in pixels, second parameter is height in pixels, third parameter is whether to crop
	

Note: parameters get passed into  add_image_size

appp_moderate_maybe_publish

Type: Filter | File: inc/settings.php | Since: 1.0.2

Allows you to intercept and modify, if needed, the array of arguments used for the publishing of the post once a photo is approved from moderation.

Default value:

array( 'ID' => absint( $parent[0] ), 'post_status' => 'publish' );
	

appp_insert_photo_post

Type: Filter | File: inc/upload.php | Since: 1.0.0

Places the uploaded image into the post content area, if user has chosen not to have the image applied to the featured image

Default value:

	$updatepost //array of post arguments for the post.