gpr_activation_admin_notice

The Google Places Reviews gpr activation admin notice function.

Description

gpr_activation_admin_notice(); 

Usage

  1. if ( !function_exists( 'gpr_activation_admin_notice' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-places-reviews/inc/activation-banner.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = gpr_activation_admin_notice(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/activation-banner.php  
  1. function gpr_activation_admin_notice() { 
  2. global $current_user, $pagenow; 
  3. $user_id = $current_user->ID; 
  4.  
  5. // Check that the user hasn't already clicked to ignore the message 
  6. if ( $pagenow == 'plugins.php' && ! get_user_meta( $user_id, 'gpr_activation_ignore_notice' ) ) { ?> 
  7. <style>div.updated.gpr,  
  8. div.updated.gpr header,  
  9. div.updated.gpr header img,  
  10. div.updated.gpr header h3,  
  11. div.updated.gpr .dismiss,  
  12. .gpr-actions,  
  13. .gpr-action,  
  14. .gpr-action #mc_embed_signup,  
  15. div.updated.gpr .gpr-action span.dashicons:before { 
  16. -webkit-box-sizing: border-box; 
  17. /* Safari/Chrome, other WebKit */ 
  18. -moz-box-sizing: border-box; 
  19. /* Firefox, other Gecko */ 
  20. box-sizing: border-box; 
  21. /* Opera/IE 8+ */ 
  22. width: 100%; 
  23. position: relative; 
  24. padding: 0; 
  25. margin: 0; 
  26. overflow: hidden; 
  27. float: none; 
  28. display: block; 
  29. text-align: left; 
  30.  
  31. .gpr-action a,  
  32. .gpr-action a:hover,  
  33. div.updated.gpr .gpr-action.mailchimp:hover,  
  34. div.updated.gpr .gpr-action.mailchimp span { 
  35. -webkit-transition: all 500ms ease-in-out; 
  36. -moz-transition: all 500ms ease-in-out; 
  37. -ms-transition: all 500ms ease-in-out; 
  38. -o-transition: all 500ms ease-in-out; 
  39. transition: all 500ms ease-in-out; 
  40.  
  41. div.updated.gpr { 
  42. margin: 1rem 0 2rem 0; 
  43.  
  44. div.updated.gpr header h3 { 
  45. line-height: 1.4; 
  46.  
  47. @media screen and (min-width: 280px) { 
  48. div.updated.gpr { 
  49. border: 0px; 
  50. background: transparent; 
  51. -webkit-box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1); 
  52. box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1); 
  53.  
  54. div.updated.gpr header { 
  55. background: #FFF; 
  56. color: #333; 
  57. position: relative; 
  58. height: 5rem; 
  59.  
  60. div.updated.gpr header img { 
  61. display: none; 
  62. max-width: 98px; 
  63. margin: 1rem; 
  64. float: left; 
  65.  
  66. div.updated.gpr header h3 { 
  67. float: left; 
  68. max-width: 60%; 
  69. margin: 1rem; 
  70. display: inline-block; 
  71.  
  72. div.updated.gpr a.dismiss { 
  73. display: block; 
  74. position: absolute; 
  75. left: auto; 
  76. top: 0; 
  77. bottom: 0; 
  78. right: 0; 
  79. width: 6rem; 
  80. background: rgba(255, 255, 255, .15); 
  81. text-align: center; 
  82.  
  83. .gpr a.dismiss:before { 
  84. font-family: 'Dashicons'; 
  85. content: "\f153"; 
  86. display: inline-block; 
  87. position: absolute; 
  88. top: 50%; 
  89.  
  90. transform: translate(-50%); 
  91. right: 40%; 
  92. margin: auto; 
  93. line-height: 0; 
  94.  
  95. div.updated.gpr a.dismiss:hover { 
  96. color: #777; 
  97. background: rgba(255, 255, 255, .5) 
  98.  
  99. /* END ACTIVATION HEADER 
  100. * START ACTIONS 
  101. */ 
  102. div.updated.gpr .gpr-action { 
  103. display: table; 
  104.  
  105. .gpr-action a,  
  106. .gpr-action #mc_embed_signup { 
  107. background: rgba(0, 0, 0, .1); 
  108. color: rgba(51, 51, 51, 1); 
  109. padding: 0 1rem 0 6rem; 
  110. height: 4rem; 
  111. display: table-cell; 
  112. vertical-align: middle; 
  113.  
  114. .gpr-action.mailchimp { 
  115. margin-bottom: -1.5rem; 
  116. top: -.5rem; 
  117.  
  118. .gpr-action.mailchimp p { 
  119. margin: 9px 0 0 0; 
  120.  
  121. .gpr-action #mc_embed_signup form { 
  122. display: inline-block; 
  123.  
  124. div.updated.gpr .gpr-action span { 
  125. display: block; 
  126. position: absolute; 
  127. left: 0; 
  128. top: 0; 
  129. bottom: 0; 
  130. height: 100%; 
  131. width: auto; 
  132.  
  133. div.updated.gpr .gpr-action span.dashicons:before { 
  134. padding: 2rem 1rem; 
  135. color: #1279be; 
  136. line-height: 0; 
  137. top: 50%; 
  138. transform: translateY(-50%); 
  139. background: rgba(163, 163, 163, .25); 
  140.  
  141. div.updated.gpr .gpr-action a:hover,  
  142. div.updated.gpr .gpr-action.mailchimp:hover { 
  143. background: rgba(0, 0, 0, .2); 
  144.  
  145. div.updated.gpr .gpr-action a { 
  146. text-decoration: none; 
  147.  
  148. div.updated.gpr .gpr-action a,  
  149. div.updated.gpr .gpr-action #mc_embed_signup { 
  150. position: relative; 
  151. overflow: visible; 
  152.  
  153. .gpr-action #mc_embed_signup form,  
  154. .gpr-action #mc_embed_signup form input#mce-EMAIL { 
  155. width: 100%; 
  156.  
  157. div.updated.gpr .mailchimp form input#mce-EMAIL + input.submit-button { 
  158. display: block; 
  159. position: relative; 
  160. top: -1.75rem; 
  161. float: right; 
  162. right: 4px; 
  163. border: 0; 
  164. background: #cccccc; 
  165. border-radius: 2px; 
  166. font-size: 10px; 
  167. color: white; 
  168. cursor: pointer; 
  169.  
  170. div.updated.gpr .mailchimp form input#mce-EMAIL:focus + input.submit-button { 
  171. background: #1279be; 
  172.  
  173. .gpr-action #mc_embed_signup form input#mce-EMAIL div#placeholder,  
  174. input#mce-EMAIL:-webkit-input-placeholder { 
  175. opacity: 0; 
  176.  
  177. @media screen and (min-width: 780px) { 
  178. div.updated.gpr header h3 { 
  179. line-height: 3; 
  180.  
  181. div.updated.gpr .mailchimp form input#mce-EMAIL + input.submit-button { 
  182. top: -1.55rem; 
  183.  
  184. div.updated.gpr header img { 
  185. display: inline-block; 
  186.  
  187. div.updated.gpr header h3 { 
  188. max-width: 50%; 
  189.  
  190. .gpr-action { 
  191. width: 30%; 
  192. float: left; 
  193.  
  194. div.updated.gpr .gpr-action a { 
  195.  
  196.  
  197. .gpr-action a,  
  198. .gpr-action #mc_embed_signup { 
  199. padding: 0 1rem 0 4rem; 
  200.  
  201. div.updated.gpr .gpr-action span.dashicons:before { 
  202.  
  203.  
  204. div.updated.gpr .gpr-action.mailchimp { 
  205. width: 40%; 
  206. }</style> 
  207. <div class="updated gpr"> 
  208. <header> 
  209. <img src="<?php echo GPR_PLUGIN_URL; ?>/assets/images/google-logo-medium.png" class="gpr-logo"/> 
  210. <h3><?php _e( 'Thank you for installing the free version of Google Places Reviews', 'google-places-reviews' ); ?></h3> 
  211. <?php printf( __( '<a href="%1$s" class="dismiss"></a>', 'google-places-reviews' ), '?gpr_nag_ignore=0' ); ?> 
  212. </header> 
  213. <div class="gpr-actions"> 
  214. <div class="gpr-action"> 
  215. <a href="<?php echo admin_url(); ?>options-general.php?page=googleplacesreviews"> 
  216. <span class="dashicons dashicons-admin-settings"></span><?php _e( 'Go to Settings', 'google-places-reviews' ); ?> 
  217. </a> 
  218. </div> 
  219.  
  220. <div class="gpr-action"> 
  221. <a href="https://wordimpress.com/plugins/google-places-reviews-pro/" target="_blank"> 
  222. <span class="dashicons dashicons-download"></span><?php _e( 'Upgrade to Pro', 'google-places-reviews' ); ?> 
  223. </a> 
  224. </div> 
  225.  
  226. <div class="gpr-action mailchimp"> 
  227. <div id="mc_embed_signup"> 
  228. <span class="dashicons dashicons-edit"></span> 
  229. <form action="//wordimpress.us3.list-manage.com/subscribe/post?u=3ccb75d68bda4381e2f45794c&id=cf1af2563c" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate> 
  230. <div class="mc-field-group"> 
  231. <p> 
  232. <small><?php _e( 'Get notified of plugin updates:', 'google-places-reviews' ); ?></small> 
  233. </p> 
  234. <input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="my.email@wordpress.com"> 
  235. <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="submit-button"> 
  236. <input type="hidden" value="8" name="group[13857]" id="mce-group[13857]-13857-3" checked="checked"> 
  237. </div> 
  238. <div id="mce-responses" class="clear"> 
  239. <div class="response" id="mce-error-response" style="display:none"></div> 
  240. <div class="response" id="mce-success-response" style="display:none"></div> 
  241. </div> 
  242. <div style="position: absolute; left: -5000px;"> 
  243. <input type="text" name="b_3ccb75d68bda4381e2f45794c_83609e2883" value=""> 
  244. </div> 
  245. </form> 
  246. </div> 
  247. </div> 
  248. </div> 
  249. </div> 
  250. <?php