sa_ostad
Forum Replies Created
-
Forum: Hacks
In reply to: How Do I Create Custom Capability for access to plugin pageThank you.
I put it my plugin activition:
function timesheet_create_roles(){ add_role( 'report_viewer', 'Report Viewer', array( 'read' => true, 'level_0' => true, 'view_reports' => true ) ); }
And this in menu :
$capability= 'view_reports' ;
And this in my page :
if( !(current_user_can('manage_options') || current_user_can('view_reports'))){ wp_die('Access Denied'); }
Forum: Hacks
In reply to: How Do I Create Custom Capability for access to plugin pageadd_cap just adds a capability to a role or specific user. It is useful when I want assign an exist capability to role, But my question is How to create New capability like capability to access to specific page to my plugin ?
Forum: Plugins
In reply to: [Contact Form Manager] Warning:Thank you.
It was Exactly my problem.I changed this line
output_buffering = 4096
To this :
output_buffering = on
in php.ini
Forum: Plugins
In reply to: [WP Photo Album Plus] filmonly type is not work on theme codethank you very much.
Forum: Plugins
In reply to: [WP Photo Album Plus] slideshow problem in touch screen deviceI Active this check-box but problem still exist ??
Forum: Plugins
In reply to: [WP Photo Album Plus] how to use lightboxThank you very much
Forum: Plugins
In reply to: [WP Photo Album Plus] How to check if album exist ?I complete my solution with google search. (thanks for Jacob old posts!)
<?php
if ( function_exists( ‘wppa_albums’ ) ){
$posts_title = “$” . the_title(“”,””,false );
global $wpdb;
$album_name = the_title(“”,””,false ); // You know how to find the name
$album_id = $wpdb->get_var( $wpdb->prepare( “SELECT id FROM “.WPPA_ALBUMS.” WHERE name = %s”, $album_name ) );
if ( wppa_album_exists( $album_id ) )
{
echo wppa_albums( $posts_title, ‘slideonly’, ‘auto’, ‘right’);
}
else
{ // Album does not exists
if ( has_post_thumbnail() ) :
the_post_thumbnail();
endif;
}
}
else
{ //plugin not activated
if ( has_post_thumbnail() ) :
the_post_thumbnail();
endif;
}
?>Forum: Plugins
In reply to: [WP Photo Album Plus] How to check if album exist ?Thank you Jacob.
can I use $album_name instead of $album_id ?
If it’s not possible how can find album_id from album_name ?