You are here

function blogapi_validate_content_type in Blog API 7.2

Validate that a content type is configured to work with BlogAPI

Parameters

string $content_type: The machine name of the content type to validate

Return value

TRUE|array TRUE if the content type is configured for use with BlogAPI or an error array if not.

3 calls to blogapi_validate_content_type()
blogapi_get_categories in ./blogapi.module
Service callback for metaWeblog.getCategories @TODO simplify this callback if possible
blogapi_get_recent_posts in ./blogapi.module
Helper function. Returns the latest few nodes created by a given user.
blogapi_new_post in ./blogapi.module
Creates a new node. Utility function for backend modules.

File

./blogapi.module, line 287
Enable users to post using applications that support BlogAPIs.

Code

function blogapi_validate_content_type($content_type) {
  $types = blogapi_get_node_types();
  if (in_array($content_type, $types, TRUE)) {
    return TRUE;
  }
  return services_error(t('BlogAPI is not configured to support the @type content type.', array(
    '@type' => $content_type,
  )), 403);
}